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

 
 

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

Submitter:  Stefan Israelsson Tampe <tampe>
Submitted:  Mon 25 Jul 2011 10:58:10 AM 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
   

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

Fixed.  Thanks for the report!

Andy Wingo <wingo>
Group 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>
Group Member

 

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

    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
    2011-08-04 wingo StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code