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

 
 

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

Submitter:  None
Submitted:  Fri 06 Apr 2007 04:18:32 AM UTC
   
 
Category:  runtime Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Suboptimal behavior
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  Anton Davis
Originator Email:  -email is unavailable- Open/Closed:  Closed
Keywords: 
* Mandatory Fields

Add a New Comment Rich Markup
   

  Spam posted by annaanna1
Fri 06 Apr 2007 05:23:37 AM UTC, 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>
Group Member
Fri 06 Apr 2007 04:18:32 AM UTC, 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-05-30 mhb StatusNone Fixed
        Open/ClosedOpen Closed
        Carbon-Copy- Added -email is unavailable-
    2010-03-14 riastradh Carbon-CopyRemoved 77162 -
    2008-07-09 riastradh Attached File#16056 Removed
    2008-07-09 None Attached File- Added valid_rss_80x15.png, #16056
    2007-04-06 riastradh CategoryNone runtime
        Item GroupIncorrect behavior Suboptimal behavior

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code