Email list hosting service & mailing list manager


Re: Alternative formulations of keywords Eli Barzilay 12 Apr 2006 03:17 UTC

On Apr 11, John Cowan wrote:
> Per Bothner scripsit:
>
> > As long as one can handle computed keywords using (apply ...) or
> > some similar higher-order function, then I really don't care about
> > computed keyword support in the "sugared syntax".
>
> I don't see the use case for computed keywords even in APPLY.  I do
> see the use case for passing *arguments* designated by keywords
> using APPLY.

(I'll be using the syntax from our library, no time to read Marc's
syntax, sorry.)

(define (assoc x l #!key test)
  ... assoc using `test' to find an item ...)

;; searches for an x association in foo's table, same keywords as `assoc'
(define (search x foo . r)
  (apply assoc x (foo-table foo) r))

--
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!