bugMIT/GNU Scheme - Bugs: bug #19535, Reduction of Lists: 'reduce'...

 
 

bug #19535: Reduction of Lists: 'reduce' reverses arguments

Submitted by:  None
Submitted on:  Fri Apr 6 04:18:32 2007  
 
Category: runtimeSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Suboptimal behavior
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: Anton Davis
Originator Email: -unavailable-Open/Closed: Closed
Keywords: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

 Spam posted by annaanna1
Fri Apr 6 05:23:37 2007, comment #1:

This is a consequence of bringing MIT Scheme up-to-date with respect to the current quasi-standard for list libraries, SRFI 1 <http://srfi.schemers.org/srfi-1/srfi-1.html>, which was designed after MIT Scheme's built-in list library. There is now a procedure which has the old semantics of REDUCE but with the name REDUCE-LEFT, although it's not yet in any released snapshot.

It's an annoying problem, and I have been working on a system that will eliminate this cluttering of a global environment with these overlapping names, but there are other tasks to be done first, such as preparing the C back end for release.

Taylor R. Campbell <riastradh>
Project Member
Fri Apr 6 04:18:32 2007, original submission:

The functions 'reduce-right', 'fold-left' and 'fold-right' work as described in the documentation, but 'reduce' produces incorrect results.

(reduce list '() '(1 2 3 4)) => (4 (3 (2 1))
(reduce - 0 '(1 2 3 4)) => 2

whereas

(list (list (list 1 2) 3) 4) => (((1 2) 3) 4)
(- (- (- 1 2) 3) 4) => -8

It seems that 'reduce' reverses the order of its arguments in release 7.7.90.+.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mhb (Updated the item)
  • -unavailable- added by mhb
  • -unavailable- added by riastradh (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu May 30 07:30:03 2013mhbStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Carbon-Copy-=>Added -unavailable-
    Sun Mar 14 19:57:20 2010riastradhCarbon-CopyRemoved 77162=>-
    Wed Jul 9 13:57:00 2008riastradhAttached File#16056=>Removed
    Wed Jul 9 07:09:59 2008NoneAttached File-=>Added valid_rss_80x15.png, #16056
    Fri Apr 6 05:23:37 2007riastradhCategoryNone=>runtime
      Item GroupIncorrect behavior=>Suboptimal behavior

    Back to the top


    Powered by Savane 3.1-cleanup