bugGuile - Bugs: bug #12994, Bug in guile's array-map!...

 
 

bug #12994: Bug in guile's array-map! transforming single array

Submitter:  None
Submitted:  Thu 05 May 2005 08:40:32 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 09 May 2005 12:03:06 AM UTC, comment #1: 

The args test was too tight, fixed in 1.6.7.

Kevin Ryde <kryde>
Group Member
Thu 05 May 2005 08:40:32 PM UTC, original submission:  

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

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-05-09 kryde StatusNone Fixed
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code