chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] #421: #!optional arguments are not "evaluated in an e


From: Chicken Trac
Subject: [Chicken-janitors] #421: #!optional arguments are not "evaluated in an environment in which all previous parameters have been bound."
Date: Sat, 30 Oct 2010 21:32:12 -0000

#421: #!optional arguments are not "evaluated in an environment in which all
previous parameters have been bound."
----------------------+-----------------------------------------------------
 Reporter:  alanpost  |       Owner:       
     Type:  defect    |      Status:  new  
 Priority:  major     |   Milestone:  4.7.0
Component:  expander  |     Version:  4.6.x
 Keywords:            |  
----------------------+-----------------------------------------------------
 Chicken Scheme uses DSSSL style lambda lists, as an extension to standard
 scheme:

 http://wiki.call-cc.org/man/4/Extensions%20to%20the%20standard

 Optional parameters are permitted to have an initializer, and the
 documentation states:

 "The corresponding <initializer> is evaluated in an environment in which
 all previous parameters have been bound."

 I would expect the following to work (note that a1 is being bound to the
 value of a0):

 (define (foo #!optional a0 (a1 a0))
   (list a0 a1))

 (foo) => (#f #f)
 (foo 0) => (0 0)

 However, I instead get the following error:

 Note: the following toplevel variables are referenced but unbound:

   a0 (in def-a123)

 I've attached a test case for #!optional parameters testing additional
 cases.

 I'm running chicken scheme from git, commit
 cd19d7e077f0a6b53c3c804c972ec3738683e9ab.

 My platform is OpenBSD 4.8-snapshot.

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/421>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

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