[plt-scheme] Dybvig's record-case better error message
Jens Axel Søgaard wrote:
> This macro works:
>
> (define-syntax (record-case stx)
Oops. I forgot that it dependd on record:
;;; record
; Description: bind a set of variables to the elements of
; a list (this list, or /record/, must contain as many
; elements as there are variables; the variables name the
; /fields/ of the record)
; Example:
; ((lambda (x)
; (record (a b c) x
; (list c b a)))
; (list 1 2 3))
(define-syntax record
(syntax-rules ()
((record (var ...) val exp ...)
(apply (lambda (var ...) exp ...) val))))
--
Jens Axel Søgaard