all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* apply or
@ 2005-04-01  8:30 puzio1
  0 siblings, 0 replies; 2+ messages in thread
From: puzio1 @ 2005-04-01  8:30 UTC (permalink / raw)





I noticed that it is not possible to feed logical connectives to "apply" as, for instance, the following examples



 (apply 'or '(t nil t nil))



 (apply 'and '(t nil t nil))



in emacs LISP because "or" and "and" are special forms as opposed to functions.  When I try these examples, I recieve the error message



 invalid-function #<subr and>



Whilst I can work around this difficulty using "member" or using "eval" and "cons", I wonder if there is a way of doing what I originally intended and directly feeding logical connectives to "apply" (or, for that matter, other functions which take a function as an argument). 





_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: apply or
       [not found] <mailman.850.1112345921.28103.help-gnu-emacs@gnu.org>
@ 2005-04-01  9:31 ` Thien-Thi Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Thien-Thi Nguyen @ 2005-04-01  9:31 UTC (permalink / raw)


"" <puzio1@excite.com> writes:

> Whilst I can work around this difficulty using "member" or using
> "eval" and "cons", I wonder if there is a way of doing what I
> originally intended and directly feeding logical connectives to
> "apply" (or, for that matter, other functions which take a
> function as an argument).

to map `and', look for `every'.
to map `or', look for `some'.

these are in (or are under) cl.el, iirc.

for the latter (parenthesized) part of your question, could you
give an example of such a function-taking-a-function?  maybe it is
not just me that is confused...

thi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-01  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-01  8:30 apply or puzio1
     [not found] <mailman.850.1112345921.28103.help-gnu-emacs@gnu.org>
2005-04-01  9:31 ` Thien-Thi Nguyen

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.