Testing a symbol against a string ***SOLVED***

Started by dukester, August 06, 2016, 05:39:10 PM

Previous topic - Next topic

dukester

I've lost a lot of the little LISP-ishness that I managed to acquire over the years. Use it or loose it ....



Anyway, I have a variable/symbol --  let's say:


(set 'name  "some_name")

Down the road, I want to test te symbol name to see if it is equal to - say "dukester".  If it is, I want to execute a function - say  "emailPerson".



I thought that the following would work:


(if (= name "dukester") (emailPerson))

But it's not working!  Maybe there's a more LISP-ish of accomplishing this? TIA ...
duke

TedWalther

#1
That code looks correct.  What is the error you are experiencing?



$ newlisp
newLISP v.10.6.2 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h

> (set 'name "dukester")
"dukester"
> (if (= name "dukester") (println "hello"))
hello
"hello"
>
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

dukester

#2
Thanks for replying! I solved the issue!!  So I'm moving on to the next step in my little project!! :)
duke