On Jul 5, 2009, at 2:23 AM, Derick Eddington wrote:
If run-time processing (lambda/kw and first-class ability) is going to
exist, it seems like it should be considered the "right" one
because it
unavoidably has to recognize values,
Say you have
(define/kw (f (a :default 1) . r) (list a r))
(define (call-f-with-default-a-and-two-args b c)
(f b c)) ;;; use default a = 1
then, according to the "expand" semantics, you get:
(call-f-with-default-a-and-two-args 2 3)
;=> (1 (2 3)) ;; as intended
and
(call-f-with-default-a-and-two-args 'a 'b)
;=> (1 (a b)) ;; of course
and
(call-f-with-default-a-and-two-args (:- a) 'b)
;=> (1 (#[keyword a] b)) ;; ditto
but according to the "run" semantics, you need to somehow provide
a way of distinguishing keywords that are intended to be used as
keywords from keywords intended to be used as values. Basically,
the last one will be "wrong" because it would evaluate to (b ()).
The more you disguise it (by using records instead of symbols),
the less likely you're to trip over it, but when you do, it would
be a spectacular failure.
This problem comes up every time you take some value from the
domain of all possible values and make it "special". Here, the
problem is that you don't know which "keyword" is intended to be
used as keyword and which is intended to be used as value. This
is similar to calling ikarus with
`ikarus --r6rs-script file' versus `ikarus file1 file2'.
What if you have a file called "--r6rs-script"? We just punt!
It is also similar to "library named (main)" problem: we'd have
to do something to disambiguate: either rename main, or rename
the conflicting name(s), or do something else, or just punt.
Aziz,,,