I'm trying to return a default value when the other conditionals are not met with the cond
statement. How can I achieve this in PicoLisp?
(de fib (n)
(cond
((= n 0) 0)
((= n 1) 1)
(+ (fib (- n 1)) (fib (- n 2))) ) )
(prinl (fib 1)) # prints 1
(prinl (fib 5)) # prints nothing
(bye)
Example coded with this reference code.
(let (Foo "bar")
(cond
((not Foo) "No foo for you")
((lst? Foo) (map 'my-list-function Foo))
((= Foo "bar") "Foobar")
"Nothing is true" ) )