I have the following function
(defun testIf (n)
(if (<= n 0) t)
print "Hello World")
My issue is when I test (testIf -1)
, it returns "Hello World". Therefore I am wondering why the if was completely ignored. Keep in mind, I just want an if in this program, no else chain. Any help would be appreciated.
To clear up confusion I am attempting to do something similar to this in lisp(as java has data types I had to compensate for this in this example)
public int testIf(n)
{
if(n <= 0)
return 5;
System.out.println("Hello "World");
return 0;
}
testIf(-1);
In Java the 5 would be returned and the next line would never be read..