﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
421	"#!optional arguments are not ""evaluated in an environment in which all previous parameters have been bound."""	Alan Post		"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."	defect	closed	major	4.9.0	expander	4.6.x	fixed			
