[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Replace define-macro with syntax-rules
From: |
Ian Price |
Subject: |
Re: [PATCH] Replace define-macro with syntax-rules |
Date: |
Sun, 29 Sep 2013 21:38:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
address@hidden (Taylan Ulrich B.) writes:
> (define-syntax endianness
> (syntax-rules ()
> ((_ big) 'big)
> ((_ little) 'little)))
Except now whenever you use it, you only ever get big endianness. You
forgot to add big and little to the literals list.
Also, IMO, if you are using literals they should be to bound identifiers.
> This removes the "unsupported endianness" error and will instead raise a
> generic syntax error ("source expression failed to match any pattern in
> form ..."). This might just be enough, but if we want it a specific
> error message could be achieved with `syntax-case', or a `syntax-error'
> macro (used in an "else" clause of `syntax-rules').
Pattern match errors are completely useless, really.
--
Ian Price -- shift-reset.com
"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"