|
From: | Stefan Israelsson Tampe |
Subject: | [bug #33854] tree-il->scheme does not translate to corrct case-lambda statement |
Date: | Mon, 25 Jul 2011 10:58:11 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101216 Linux Mint/1 (Debian) Firefox/3.6.13 |
URL: <http://savannah.gnu.org/bugs/?33854> Summary: tree-il->scheme does not translate to corrct case-lambda statement Project: Guile Submitted by: tampe Submitted on: Mon 25 Jul 2011 10:58:10 AM GMT Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: 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. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?33854> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |