by eddieh · 10y ago · 0 comments
A small code example can tell you way more than a language description. An example is the PL equivalent of the picture is worth a thousand words adage.
Additionally, it is not a given that a LISP will use S-expressions. It could use M-expressions, or even G-expressions (form a LISP like language I helped develop that nobody has ever heard of).
Go, Rust, Ruby, Python all have examples on their homepage. Oddly, Swift does not.
define fib (n)
if (= n 0) 0
elsif: (= n 1) 1
else: (+ (fib (- n 1)) (fib (- n 2)))
println (fib 20)