all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mike Mattie <codermattie@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: find.el --- Build a valid find(1) command with sexps
Date: Tue, 1 Apr 2008 18:41:49 -0700	[thread overview]
Message-ID: <20080401184149.33c1cf4a@reforged> (raw)
In-Reply-To: <7dbe73ed0804011417k33abed71xde9e3bb631862fd7@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

On Tue, 1 Apr 2008 23:17:10 +0200
"Mathias Dahl" <mathias.dahl@gmail.com> wrote:

> >  Also, I think that it should be a function rather than a macro.
> >  (That would require explicitly quoting the arguments.)
> 
> Could some explain to a lisp beginner like me what the benefit is? The
> macro version seems easier to use as you don't have to quote the
> arguments - to me that seems like a good thing.
> 
> 

I rather like macros but they have their own dangers. The programmer is required to see the code in two
phases at the same time: compile phase, and evaluation phase. Also elisp macros are not hygienic
so there is always the possibility of unintended capture for more complex macros. Also for debugging to
work you need to define a debug spec. Debug-ability goes down as the complexity of the macro increases.

The KISS principle is to engineering what Occam's razor is to science.

Another issue that I haven't seen mentioned is that macros set a far higher bar for documentation.
With the great power of the macro comes a great responsibility to explain to others clearly and
succinctly what your macro does.

These are my experiences at least. I wouldn't concede macros for any other feature in a language,
but they require judicious application.

Macros are certainly not a wand to wave away quotes, though a may have written a few like that ... *couph*.

Cheers,
Mike Mattie

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-04-02  1:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87k5ji3jd6.fsf@shellarchive.co.uk>
2008-04-01 16:55 ` find.el --- Build a valid find(1) command with sexps Richard Stallman
2008-04-01 17:52   ` Phil Jackson
2008-04-02 18:45     ` Phil Jackson
2008-04-01 21:17   ` Mathias Dahl
2008-04-02  1:41     ` Mike Mattie [this message]
2008-04-02  2:53     ` Richard Stallman

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

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

  git send-email \
    --in-reply-to=20080401184149.33c1cf4a@reforged \
    --to=codermattie@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.