Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Keyword arguments in R7RS

Name: Anonymous 2010-03-18 6:27

Things are getting spicy.
[quote]
Neil Van Dyke
To get the keyword arguments discussion started, I'll provide a quick,
loosely-defined strawperson...
* Keywords look like ":foo", "foo:", or "#:foo", depending on your dialect.
* The main use of keywords is to name "keyword arguments" in procedure
applications and syntax uses, such as for optional arguments or for clarity.
* "lambda" is extended to permit keyword arguments to be defined, each
of which argument may have a default value.  The argument is optional
iff a default value was defined.
* The various syntax definition forms should permit syntax transformers
to be keyword-aware as well.
* Example:
(define f (lambda (a b c (:foo 42) :bar)  foo))
(f 1 2 3 :foo 4 :bar 5) ==> 4
(f 1 2 3 :bar 5) ==> 42
(f 1 2 3) =error=> :bar keyword argument required
(f 1 2 3 :foo 4 :bar 5 :zoo 6) =error=> unrecognized keyword :zoo
* Note: If keywords are first-class values, and you want to pass a
keyword as an argument in an application in a position in which it might
be parsed as a keyword, you cannot put  a keyword literal into the
application syntax directly.
* I probably wouldn't have keyword arguments in WG2, but their
implementation in WG2 would likely impose requirements on WG1.
--
[/quote]

Working Group 1 thread:
https://groups.google.com/group/scheme-reports-wg1/browse_frm/thread/3c0c5a48a520f32d
or
Working Group 2 thread:
https://groups.google.com/group/scheme-reports-wg2/browse_frm/thread/4f4b2a9a0eb86450

...what do the resident clispers in prague think? Should they exist in the core language or should we have a supplementary (i.e. "defun" in all its glory) macro for WG2 Scheme?

Name: Anonymous 2010-03-18 7:41

>>6
The whole concept of parameter *objects* are nice (i.e. you don't want to carry around dynamic bindings, too) but goddamn I want to dismember whoever thought of that name.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List