bugGuile - Bugs: bug #33854, tree-il->scheme does not...

 
 

bug #33854: tree-il->scheme does not translate to corrct case-lambda statement

Submitted by:  Stefan Israelsson Tampe <tampe>
Submitted on:  Mon 25 Jul 2011 10:58:10 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 04 Aug 2011 05:26:19 PM UTC, comment #1:

Fixed. Thanks for the report!

Andy Wingo <wingo>
Project Administrator
Mon 25 Jul 2011 10:58:10 AM UTC, original submission:

Problem
scheme@(guile-user)> (tree-il->scheme (macroexpand '(define f (case-lambda ((a) a) ((a b) b)))))

$1 = (define f (case-lambda
((#{a 1029}#) #{a 1029}#)
(#{a 1031}# #{b 1032}#) #{b 1032}#))

The reason is that the last statement is translated to lambda
e.g. (lambda (a b) b) but code assumes (case-lambda ((a b) b)))
and then when splicing with (cdr tail-result) the wrong form will
appear. The solution is to write a custom "cdr" function that check to see if the car is lambda lambda* case-lambda case-lambda*
and depending on lambda or case-lambda forms issue different cdr versions so that the overall case-lambda will be well formed.

Stefan Israelsson Tampe <tampe>
Project Member

 

(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 wingo (Posted a comment)
  • -unavailable- added by tampe (Submitted the item)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 04 Aug 2011 05:26:19 PM UTCwingoStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1