URL:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=12994>
Summary: Bug in guile's array-map! transforming single array
Project: Guile
Submitted by: None
Submitted on: Thu 05/05/2005 at 16:40
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
_______________________________________________________
Details:
Hello,
I have been using Guile with Cygwin for a while, and with pleasure; recently
I tried upgrading from version 1.6.4 to 1.6.5,
but with the new version some of my scripts do not work any more.
The problem appears to be with array-map!.
When I apply it to a single array to do a simple calculation,
it complains that "At least one source array is required.",
for instance, when I do
(define a #(1 2 3 4 5 6))
(define (sqr x) (* x x))
(array-map! a sqr a)
I used to get (in Guile 1.6.4):
1 4 9 16 25 36
but in Guile 1.6.5 it no longer works, I get the error message.
The cause of this seems to be a change in ./libguile/ramap.c;
The first few lines used to read:
{
SCM_VALIDATE_PROC (2,proc);
SCM_VALIDATE_REST_ARGUMENT (lra);
switch (SCM_TYP7 (proc))
But in 1.6.5, this has been changed to:
{
SCM_VALIDATE_PROC (2,proc);
if (!(SCM_CONSP (sources) && SCM_CONSP (SCM_CDR (sources))))
{
SCM_MISC_ERROR ("At least one source array is required.", SCM_EOL);
}
switch (SCM_TYP7 (proc))
Why is this? Surely the invocation with a single array
was a useful thing to be able to do?
Is there a deeper reason for the second SCM_CONSP? Or can we get rid of it?
Best regards,
Mischa
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=12994>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-guile mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-guile