Am Mi., 30. Sept. 2026 um 04:02 Uhr schrieb Wolfgang Corcoran-Mathe
<xxxxxx@sigwinch.xyz>:
>
> Zhu,
>
> On 2026-09-03 22:56 +0800, Zhu Zihao wrote:
> > I don't understand why it can't be implemented in `syntax-rules` ...
> >
> > Therefore, an implementation like
> >
> > (define-syntax endianness
> > (syntax-rules ()
> > ((endianness name)
> > (case 'name
> > ((big) 'big)
> > ((little) 'little)
> > (else (error "Invalid endianness type" 'name))))))
>
> I don’t understand this either, but I understand the use of ‘case’ in
> this example even less! Why didn’t you just write:
>
> (syntax-rules (big little)
> ((_ big) 'big)
> ((_ little) 'little)
> ((_ e) (syntax-error "bad endianness" e)))
This would only be reliable if big and little were bound identifiers.
And it would be incompatible with R6RS.
>
> You get an expansion-time error if the identifier is wrong. Surely
> this is portable R7RS?
>
> (Sorry, the message I just sent to the 281 list will repeat some of
> this.)
>
> --
> Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>