all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Purpose of dash # in elisp
Date: Mon, 09 Nov 2009 11:53:50 +0100	[thread overview]
Message-ID: <87r5s8x935.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: ba5d5e0f-2f0b-4b9f-842f-626da886de50@15g2000yqy.googlegroups.com

Nordlöw <per.nordlow@gmail.com> writes:

> What purpose does # as a quote suffix?

You mean as prefix, e.g.

    (mapcar #'oddp '(1 2 3))

versus

    (mapcar 'oddp '(1 2 3))?

Both forms are completely equivalent (try disassembling them), but the
former is more common to a common lisp programmer, where you pass
function symbols with the `function' macro and its reader form #', and
other symbols that should not be evaled with `quote' (which is ').

If you stick to the convention to always use #' when passing a function
as arguments, the code might be a littlebit more explanatory, because
then you can see that a function is passed on a first glance.  On the
other hand, in elisp the reader won't error or warn if you use #' to
pass anything different, so this convention wouldn't be enforced
somehow.

Bye,
Tassilo





  parent reply	other threads:[~2009-11-09 10:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08 20:01 Purpose of dash # in elisp Nordlöw
2009-11-08 21:29 ` Pascal J. Bourguignon
2009-11-09 10:53 ` Tassilo Horn [this message]
     [not found] ` <mailman.10334.1257764064.2239.help-gnu-emacs@gnu.org>
2009-11-09 13:00   ` Pascal J. Bourguignon
2009-11-09 17:27     ` Lennart Borgman

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=87r5s8x935.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --cc=help-gnu-emacs@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.