unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* fif function from On Lisp
@ 2008-03-04 12:31 weber
  2008-03-04 12:53 ` Johan Bockgård
  2008-03-06  0:34 ` Mike Mattie
  0 siblings, 2 replies; 6+ messages in thread
From: weber @ 2008-03-04 12:31 UTC (permalink / raw)
  To: help-gnu-emacs

Hi folks.
For some reason this function from On Lisp doesn't work:

(defun fif (a b &optional c)
  '(lambda (x)
	(if (funcall a x)
		(funcall b x)
		(unless (null c) (funcall c x)))))

I should be able to call it like this:

(mapcar (fif 'zerop '1+ 1-) '(0 1 2 3) => (1 0 1 2)

but i'm probably missing something that is differs from Common Lisp to
Elisp.

Thanks in advance,
weber


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

end of thread, other threads:[~2008-03-06  0:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-04 12:31 fif function from On Lisp weber
2008-03-04 12:53 ` Johan Bockgård
2008-03-04 13:59   ` weber
2008-03-04 14:07     ` weber
2008-03-04 14:12       ` weber
2008-03-06  0:34 ` Mike Mattie

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).