guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix for `make-uniform-array'


From: Ludovic Courtès
Subject: [PATCH] Fix for `make-uniform-array'
Date: Wed, 01 Feb 2006 09:28:58 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi,

The following patch fixes `make-uniform-array' in 1.7 so that it
properly initializes vectors according to the FILL argument --- see the
discussion on `guile-user'[0].

The `#\nul' case mentioned in that thread remains somewhat incompatible
but perhaps this is not too much of a problem.  Hmm...

  $ guile-1.6
  guile> (make-uniform-array #\nul 10)
  #y(0 0 0 0 0 0 0 0 0 0)

  $ ./pre-inst-guile  # i.e., 1.7
  guile> (define a (make-uniform-array #\nul 10))
  ERROR: Wrong type (expecting exact integer): #\nul
  ABORT: (wrong-type-arg)

This may require fixing `dimensions->uniform-array'.  What do you think?

Thanks,
Ludovic.

[0] http://lists.gnu.org/archive/html/guile-user/2006-01/msg00086.html


2006-01-01  Ludovic Courtès  <address@hidden>

        * deprecated.scm (make-uniform-array): Fill the returned vector
        with PROT.


--- orig/ice-9/deprecated.scm
+++ mod/ice-9/deprecated.scm
@@ -173,8 +173,8 @@
 
 (define make-uniform-vector dimensions->uniform-array)
 
-(define (make-uniform-array prot . args)
-  (dimensions->uniform-array args prot))
+(define (make-uniform-array prot . bounds)
+  (dimensions->uniform-array bounds prot prot))
  
 (define (list->uniform-vector prot lst)
   (list->uniform-array 1 prot lst))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]