Am 25.09.2005, 20:44 Uhr, schrieb Shawn Rutledge <[EMAIL PROTECTED]>:

[...]
The "even number of args" requirement is a little odd though.  Another
syntax for this kind of functionality would be

(fn (i . 1) (j . 2))

which seems more like typical scheme to me, and you don't need the
special meaning for symbols that end with colon.
[...]

Hello,

the syntax you propose has the disadvantage that you would have to quote it clumsily like this:
  (fn `(i . ,1) `(j . ,2))
or use a construct like
  (fn (cons 'i 1) (cons 'j 2))
in order to make it really work.

Well, I admit that in the given simple case you could just use
  (fn '(i . 1) (j . 2))
but you cannot do that any longer once the part after the dot is variable.

Nevertheless the keyword magic may not be to everyone's taste -- but if you don't like it, just don't use it ;) Your syntax can easily be achieved by using a construct like this:
  (define (fn . args)
     (let ((i (alist-ref args 'i))
             (j (alist-ref args 'j)))
       <do something to i and j>))

cu,
Thomas


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to