all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dan.colascione@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
	 Eric Schulte <schulte.eric@gmail.com>,
	emacs-devel@gnu.org
Subject: Re: How to fix Emacs24 compiler warning w/o breaking code for previous versions
Date: Sun, 19 Jun 2011 14:14:32 -0700	[thread overview]
Message-ID: <4DFE66B8.7030402@gmail.com> (raw)
In-Reply-To: <811uytyvgc.fsf@gmail.com>

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

On 6/16/11 8:42 PM, Jambunathan K wrote:
> I was hoping that there is an elisp equivalent for C-like
> 
> #if emacs-version > a
>     do this
> #else
>     do that
> #endif
> 

The Common Lisp #+ reader macro provides the facility you want. For example,

    (progn #+some-feature 42)

would read as

    (progn 42)

on systems with some-feature present and

    (progn)

on systems without that feature.

CL also allows arbitrary combinations of and, or, and not calls, e.g,

    #+(or feature1 (not feature2))

#- also exists, and is similar, except that the sense of the test is
inverted.

Might this feature be worth adding to Emacs? Of course, it would only
help code written for Emacs 24 and above.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  parent reply	other threads:[~2011-06-19 21:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 17:44 How to fix Emacs24 compiler warning w/o breaking code for previous versions Eric Schulte
2011-06-17  3:10 ` Stefan Monnier
2011-06-17  3:42   ` Jambunathan K
2011-06-17  6:34     ` Stephen J. Turnbull
2011-06-17  7:17       ` Eli Zaretskii
2011-06-19 21:14     ` Daniel Colascione [this message]
2011-06-20  7:53     ` David Kastrup
2011-06-17  4:45   ` Eric Schulte
2011-06-17  7:19 ` David Engster

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=4DFE66B8.7030402@gmail.com \
    --to=dan.colascione@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=schulte.eric@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.
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.