by mahmud · 16y ago · 0 comments
Also, you don't need to invent backcronyms for CAR/CDR, they're now called first/rest.
Having said that, I really like the presentation of your blog, nice typography. And after skimming your book[1] in progress, and noting your obvious theoretical bent and taste for rigor, I can only anticipate to read more of your future posts (latch on to something "obscure" like ACL2 and make something fun with it.)
[1] http://symbo1ics.com/blog/?page_id=77
[Edit:
The book has code samples in 4 different languages; LISP (the ancient cap-cased "one"), ML, C, and what looks like Pascal. If you want to learn about the axiomatic specification of computer programs, specially for "structured" programming, then look into the works of Gries and others, specially in the silver "Texts and Monographs In Computer Science" books (the entire series is a feast of delight that should be devoured, and washed down with heirloom, stolen wine):
The Science of Programming, Gries.
The Design of Well-Structured and Correct Programs, Alagic and Arbib.
The selection Programming Methodology edited by Gries has various approaches to the structured method, with contributions from Dijkstra, Hoare, Wirth, Reynolds and other rock-stars of axiomatic semantics and verification.]
I, too, am looking forward to more posts; it's worth checking out the posts that are up already. Definitely my kind of thing (see my http://copperthoughts.com/p/set-theory-and-lisp/).
This is where I'll refer people who know nothing about Lisp when they complain about it; not too self-righteous, pleasantly informative, and theoretically interesting.
Actually, now that I think about it, "fire" is much cooler sounding than "cadr". But not as cool sounding as cadadr.
(def coll [[1 2 3]
[4 5 6]
[7 8 9]])
(second (second coll)) ; => 5
And often when I'm digging deep inside a nested data structure, I don't need just one piece of data, so destructuring comes in handy: (let [[[top-left]
[_ middle]
[_ _ bottom-right]] coll]
[top-left middle bottom-right]) ; => [1 5 9](I prefer pattern matching / destructuring-bind, though.)
In Clojure it's usually more idiomatic to use destructuring, which I think is much more understandable since the form follows the structure that is being accessed.
Or you can use get-in, which takes a sequence of keys to dig into a deep associative data structure. It doesn't work with sequences, but building highly nested seqs is rather uncommon in Clojure.