29 ms·
let* is nothing but nested lets, which, in turn, are nested lamdas. (let* ((a 1) (b a)) (+ a b)) is an abbreviation for (let ((a 1)) (let ((b a
by dschiptsov 12y ago
let* is nothing but nested lets, which, in turn, are nested lamdas.
(let* ((a 1) (b a))
(+ a b))
is an abbreviation for
(let ((a 1))
(let ((b a))
(+ a b))))
which, in turn, is a syntactic sugar for
((lambda (a)
((lambda (b)
(+ a b)) a)) 1)
There is no "assignment", only lexicaly scooped bindings, which are "stateless" and "declarative".
Looping constructs in Racket are just syntactic sugar - layered macros, based on what they call "contracts", I suppose.
In CL looping constructs are micro-DSLs.
- taeric 12y agoYeah, I chose a somewhat poor example. My main point was that order matters, you have to do A before B. You can not do them at the same time, or something different happens. (Contrasted with a language like VHDL where everything typically happens at the same time.) Simply put, functional is not necessarily the opposite of imperative. I took to googling to see if someone had made my point better already. The best I found quickly is this[1]. It is a good read. As it points out that we are most likely both stuck on different numbers in the "opposite of imperative" definition world. I will say that throwing out mutability with the bathwater is perhaps the single most frustrating thing with most functional advocacy. [1] https://existentialtype.wordpress.com/2013/07/18/what-if-anything-is-a-declarative-language/ https://existentialtype.wordpress.com/2013/07/18/what-if-any...