[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] Draft 3 Comments: Chapter 4
Denis Washington scripsit:
> This is a nice trick indeed, but does suffer from some subtle
> complications. Consider the usage example on KeywordArgumentsArcfide:
>
> (define/optional (blah a b c (x: 0) (y: 7))
> (list a b c x: y:))
>
> What if you don't want to call "list", but another procedure which
> itself accepts "x:" and "y:" keyword arguments?
Good point. This is a consequence of a basic Scheme limitation: once
a binding has been shadowed by a more local binding, there is no way
to retrieve the outer binding. A better approach for define/optional
might be to have it take triples rather than doubles: a local variable,
a keyword (always globally bound), and a default value.
--
May the hair on your toes never fall out! John Cowan
--Thorin Oakenshield (to Bilbo) cowan@x
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports