[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do you pre-evaluate a function passed to a macro?
From: |
Stefan Monnier |
Subject: |
Re: How do you pre-evaluate a function passed to a macro? |
Date: |
Sat, 14 Nov 2009 03:18:25 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
> I'm calling a function, wanting to pass nil instead of the empty string
> when the string argument is zero length. But the function is defined as
> a macro, so the argument gets passed in unevaluated, which fails.
> How do I force evaluation of the argument before it is passed in?
> --8<---------------cut here---------------start------------->8---
> ;; myname is a string taken from user input
> (bbdb-search (bbdb-records) (if (> (length myname) 0) myname nil) nil
> nil)
(if (> (length myname) 0)
(bbdb-search (bbdb-records) myname nil nil)
(bbdb-search (bbdb-records) nil nil nil))
Stefan