chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] DSSSL keyword args combined with rest and opti


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] DSSSL keyword args combined with rest and optional
Date: Sun, 22 Apr 2012 13:36:29 +0200
User-agent: Mutt/1.4.2.3i

Hi all,

This was reported on IRC:
|10:27| ( rwinkler) ((lambda (x y #!optional z #!rest r #!key i (j 1)) 
|10:27| ( rwinkler)     (list x y z i: i j: j))
|10:27| ( rwinkler)  3 4 5 i: 6 i: 7) => (3 4 5 i: #f j: 1)
|10:27| ( rwinkler) (in my csi in emacs)
|10:28| ( rwinkler) why does this call yield (3 4 5 i: #f j: 1) and not (3 4 5 
i: 6 j: 1) as is documented?

Attached is a fix.  The keyword args should be taken either from the
dotted tail varargs (as before), or the rest args in the let-optional
if there are any.  The patch should speak for itself.

I tried to add a few more testcases, but I'm sure they're not exhaustive.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: 0001-Fix-DSSSL-key-arg-handling-in-the-presence-of-option.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]