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

 
 

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

Submitted by:  None
Submitted on:  Fri 06 Apr 2007 04:18:32 AM UTC  
 
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 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>
Project 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 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 30 May 2013 07:30:03 AM UTCmhbStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Carbon-Copy-=>Added -unavailable-
    Sun 14 Mar 2010 07:57:20 PM UTCriastradhCarbon-CopyRemoved 77162=>-
    Wed 09 Jul 2008 01:57:00 PM UTCriastradhAttached File#16056=>Removed
    Wed 09 Jul 2008 07:09:59 AM UTCNoneAttached File-=>Added valid_rss_80x15.png, #16056
    Fri 06 Apr 2007 05:23:37 AM UTCriastradhCategoryNone=>runtime
      Item GroupIncorrect behavior=>Suboptimal behavior

    Back to the top


    Powered by Savane 3.1-cleanup