On Thu, Mar 12, 2009 at 10:46 AM, Uwe Brauer <oub(a)mat.ucm.es> wrote:
>>>>> "Sean" == Sean MacLennan
> On Thu, 12 Mar 2009 17:05:43 +0100
> Uwe Brauer <oub(a)mat.ucm.es> wrote:
>> Now in a function I want to execute certain code
>> - if isp is indeed the string "hallo" and
>> - if isp is the string "test" then another part of the code
>> will be executed.
> string= is your friend!
(defvar isp "hallo" )
> (if (string= isp "hallo") (message "hallo"))
I presumed it would be simple, but this simple!
He said "simple". Heh, heh, heh, heh. `string=' is
typed. To be completely defensive against users
who will (setq isp 3.1415926) ; Happy National PI Day!
you need a guard as in:
(when (and (stringp isp) (string= isp "hallo"))
XEmacs-Beta mailing list