guile-user
[Top][All Lists]
Advanced

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

Re: uniform-array-read!


From: Jon Wilson
Subject: Re: uniform-array-read!
Date: Tue, 31 Jan 2006 08:50:15 -0600
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050324)


Hi y'all,


Using Guile 1.7:

  guile> (define a (make-uniform-array #\nul 10))
  guile> (uniform-array-read! a (open-input-string (string #\001 #\002 #\003)))
  3
  guile> a
  #s8(1 2 3 32 51 10 -102 96 48 10)
  guile>

IOW, it seems to work fine --- except that:

 1. The array is not properly initialized;

 2. The result is not a string as one would expect from the Guile 1.6
    manual[*] (in fact it could hardly be a string since internally
    strings may not contain null characters AFAIK).

So 1.7 is _not_ compatible with 1.6 in that respect.  I guess we need to
fix this.

Here is the same in 1.6, just for good measure:

guile> (define a (make-uniform-array #\nul 10))
guile> a
#y(0 0 0 0 0 0 0 0 0 0)
guile> (uniform-array-read! a (open-input-string (string #\001 #\002 #\003)))
3
guile> a
#y(1 2 3 0 0 0 0 0 0 0)

The result is not a string, probably because the array was originally defined to be filled with null chars. If I define the array to originally contain some valid character, then subsequently it displays as a string.

Regards,
Jon




reply via email to

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