How is Lisp dynamic and compiled?

Lisp is a wide family of language and implementations. Dynamic in the context of Lisp means that the code has a certain flexibility at runtime. It can be changed or replaced for example. This is not the same as dynamically typed. Compilation in Lisp Often Lisp implementations have a compiler available at runtime. When this …

Read more

let vs def in clojure

The problem is that your use of let is wrong. let works like this: (let [identifier (expr)]) So your example should be something like this: (let [s (Scanner. “a b c”)] (exprs)) You can only use the lexical bindings made with let within the scope of let (the opening and closing parens). Let just creates …

Read more

Homoiconicity, How does it work?

Before I proceed with some things I wanted to add another answer for, here’s one more reference — the part related to homoiconicity is fairly short, but it is Rich Hickey doing the explaining! Channel 9 has this nice video with Rich Hickey and Brian Beckman talking about Clojure. Concurrency is, understandably, the major focus, …

Read more

Why should I use ‘apply’ in Clojure?

You would use apply, if the number of arguments to pass to the function is not known at compile-time (sorry, don’t know Clojure syntax all that well, resorting to Scheme): (define (call-other-1 func arg) (func arg)) (define (call-other-2 func arg1 arg2) (func arg1 arg2)) As long as the number of arguments is known at compile …

Read more