On Sun, 2009-07-05 at 01:26 +0300, Abdulaziz Ghuloum wrote:
> On Jul 4, 2009, at 11:47 PM, Derick Eddington wrote:
> > Run-time processing needs keywords to be a distinct type.  So now I'm
> > considering:
> >
> > (define/kw (f x y (a) (b :boolean) . r) (list x y a b r))
> > (f 1 2 3 (:- b) 4 (:- a) 5 6)
> > => (1 2 5 #T (3 4 6))
> >
> > where :- creates instances of a distinct keyword type at run-time.
> 
> I thought keywords were already tagged with something like this.
> When did you switch to using quote for tagging?

This thread's initial post (7 months ago) was about the switch (and
about new expand-time processing).  Previously, the :- was like
  (f (:- (a 1) (b 2)))
but now I'm thinking
  (f (:- a) 1 (:- b) 2)
so that keywords are independent of their values, which seems good for
possibilities like
  (apply f (:- a) (append `(1 ,(:- b)) '(2)))

> > define/kw could still define macros which recognize (:- kw) syntax but
> > the expand-time processing would still be inconsistent with the run- 
> > time
> > processing.
> 
> Why?

Because the expand-time processing can only recognize (:- ---) syntax
(or quote like it currently does) but not arbitrary expressions which
might evaluate to a keyword, whereas run-time processing recognizes
values.  E.g.:
  (define/kw (f (a :default 1) . r) (list a r))
  (define (make-kw) (:- a))
  (f (make-kw) 2)
  => (1 (#[keyword a] 2))
  ((values f) (make-kw) 2)
  => (2 ())
is inconsistent and doesn't seem acceptable.

> > So I think I'm going to drop the expand-time processing
> > altogether and make define/kw simply use lambda/kw.
> 
> Aren't you giving up too fast!  :-)

Maybe :)  But I don't have any idea how to fix the above inconsistency.

-- 
: Derick
----------------------------------------------------------------

Reply via email to