From: Greg Hill <ghill@synergymicro.com>
Subject: Lisp: Functions for multiple comparisons
Date: Wed, 20 Nov 2002 13:14:16 -0800 [thread overview]
Message-ID: <p04310101ba01a3e2d6f1@[198.17.100.22]> (raw)
In-Reply-To: <slrnark2qo.sdv.matt@squeaker.lickey.com>
I am aware of the built-in functions memq and member. But what I
really want is a pair of special forms that work more like 'or and
'and. The first argument would be compared against all of the rest
using either 'eq or 'equal, returning 't if any match was found.
For example, a special form using an 'eq comarison might be named
'meq and be called like:
(meq (char-syntax (following-char)) ?w ?_)
instead of using
(memq (char-syntax (following-char) '(?w ?_)))
or
(or (eq (char-syntax (following-char)) ?w) (eq (char-syntax
(following-char)) ?_))
or
(let ((syntax (char-syntax (following-char)))) (or (eq syntax
?w) (eq syntax ?_)))
Is there already something like that that I simply am not yet aware
of? If not, am I wrong in thinking that the kind of special forms I
am imagining would be computationally more efficient than any of the
alternatives shown above?
--Greg
next prev parent reply other threads:[~2002-11-20 21:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1035590178.16479.help-gnu-emacs@gnu.org>
2002-10-26 3:26 ` please explain diff bet. K&R and Linux c-mode styles Matt Armstrong
2002-10-29 0:37 ` seberino
2002-10-29 13:28 ` Kevin Dziulko
2002-10-29 13:55 ` Alfred M. Szmidt
[not found] ` <mailman.1035851913.4061.help-gnu-emacs@gnu.org>
2002-10-29 2:33 ` Edgar Antonio Luna Díaz
2002-11-15 2:54 ` Emacs Lisp: Problem with nested condition-case and catch in byte compiled code Greg Hill
2002-11-15 18:22 ` Greg Hill
[not found] ` <mailman.1037661783.25741.help-gnu-emacs@gnu.org>
2002-11-19 0:08 ` Stefan Monnier <foo@acm.com>
2002-11-19 2:47 ` Greg Hill
2002-11-20 21:14 ` Greg Hill [this message]
[not found] ` <mailman.1037827276.893.help-gnu-emacs@gnu.org>
2002-11-20 23:03 ` Lisp: Functions for multiple comparisons Stefan Monnier <foo@acm.com>
2002-11-21 19:56 ` Pascal Bourguignon
2002-11-27 19:07 ` Index of element in a sequence Greg Hill
[not found] ` <mailman.1038424169.3933.help-gnu-emacs@gnu.org>
2002-11-27 19:23 ` Barry Margolin
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/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='p04310101ba01a3e2d6f1@[198.17.100.22]' \
--to=ghill@synergymicro.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).