[plt-scheme] Keyword args

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Oct 22 01:11:30 EDT 2004

On Oct 21, Alex Peake wrote:
> ;; Scans a Lisp-style keyword/value property list.
> (define (getarg initargs name . not-found)
>   (define (scan tail)
>     (cond ((null? tail) (if (pair? not-found)
>                             (car not-found)
>                             (error 'getarg "couldn't find ~e." name)))
>           ((null? (cdr tail)) (error 'getarg "keyword list not balanced ~e." (car tail)))
>           ((eq? (car tail) name) (cadr tail))
>           (else (scan (cddr tail)))))
>   (scan initargs)))

This is from a really old version of Swindle, slightly edited.
Probably used someplace else.

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

Posted on the users mailing list.