unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [bug #33854] tree-il->scheme does not translate to corrct case-lambda statement
@ 2011-07-25 10:58 Stefan Israelsson Tampe
  2011-08-04 17:26 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Israelsson Tampe @ 2011-07-25 10:58 UTC (permalink / raw)
  To: Stefan Israelsson Tampe, bug-guile

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/




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [bug #33854] tree-il->scheme does not translate to corrct case-lambda statement
  2011-07-25 10:58 [bug #33854] tree-il->scheme does not translate to corrct case-lambda statement Stefan Israelsson Tampe
@ 2011-08-04 17:26 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2011-08-04 17:26 UTC (permalink / raw)
  To: Andy Wingo, Stefan Israelsson Tampe, bug-guile

Update of bug #33854 (project guile):

                  Status:                    None => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

Fixed.  Thanks for the report!

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33854>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-04 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-25 10:58 [bug #33854] tree-il->scheme does not translate to corrct case-lambda statement Stefan Israelsson Tampe
2011-08-04 17:26 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).