unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Fix for `make-uniform-array'
@ 2006-02-01  8:28 Ludovic Courtès
  2006-02-02 20:53 ` Kevin Ryde
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2006-02-01  8:28 UTC (permalink / raw)


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  <ludovic.courtes@laas.fr>

	* 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))



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-12  1:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-01  8:28 [PATCH] Fix for `make-uniform-array' Ludovic Courtès
2006-02-02 20:53 ` Kevin Ryde
2006-02-12  1:08   ` Marius Vollmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).