unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Ian Price <ianprice90@googlemail.com>
To: taylanbayirli@gmail.com (Taylan Ulrich B.)
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Replace define-macro with syntax-rules
Date: Sun, 29 Sep 2013 21:38:02 +0100	[thread overview]
Message-ID: <87eh87bbyt.fsf@Kagami.home> (raw)
In-Reply-To: <87mwmxgs1u.fsf@taylan.uni.cx> (Taylan Ulrich B.'s message of "Sat, 28 Sep 2013 12:27:09 +0200")

taylanbayirli@gmail.com (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"



  reply	other threads:[~2013-09-29 20:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-28  5:25 [PATCH] Replace define-macro with syntax-rules KAction
2013-09-28 10:27 ` Taylan Ulrich B.
2013-09-29 20:38   ` Ian Price [this message]
2013-09-30 19:24     ` Taylan Ulrich B.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eh87bbyt.fsf@Kagami.home \
    --to=ianprice90@googlemail.com \
    --cc=guile-devel@gnu.org \
    --cc=taylanbayirli@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).