Hi,

stefan <stefan.ta...@spray.se> writes:

> On Wednesday 21 April 2010 10:40:29 am Ludovic Courtès wrote:
>> As noted in Shinn’s match-cond-expand.scm, this record matching form is
>> not ideal:
>> 
>>   ;; Annoying unhygienic record matching.  Record patterns look like
>>   ;;   ($ record fields...)
>>   ;; where the record name simply assumes that the same name suffixed
>>   ;; with a "?" is the correct predicate.
>> 
>
> Entering,
>
> scheme@(guile-user)> (macroexpand '(n? x))
> (if (struct? x) (eq? (struct-vtable x) n) #f)

That’s an implementation detail that you should ignore.  :-)

Just have users write:

  (($ n? a b c) ...)

Where ‘n?’ is bound to the record type predicate, and have ‘match’
invoke that record type predicate.

Thanks,
Ludo’.



Reply via email to