This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-03
Channels
- # aleph (1)
- # beginners (99)
- # boot (16)
- # cider (35)
- # cljs-dev (46)
- # cljsrn (7)
- # clojure (152)
- # clojure-austin (7)
- # clojure-dusseldorf (8)
- # clojure-italy (1)
- # clojure-uk (7)
- # clojurescript (3)
- # core-async (12)
- # css (8)
- # cursive (18)
- # datascript (2)
- # datomic (19)
- # defnpodcast (6)
- # duct (3)
- # editors (8)
- # emacs (8)
- # figwheel (1)
- # fulcro (20)
- # hoplon (18)
- # jobs-discuss (5)
- # lein-figwheel (1)
- # luminus (3)
- # lumo (19)
- # off-topic (15)
- # onyx (9)
- # parinfer (2)
- # planck (6)
- # portland-or (7)
- # re-frame (4)
- # reagent (7)
- # remote-jobs (1)
- # ring (6)
- # ring-swagger (4)
- # spacemacs (10)
- # specter (3)
- # unrepl (131)
Does anybody know why the word “form” is used in “lisp form”? There are various other pieces of info that defines “lisp form” identically to “expression”. If that’s the case, then why weren’t “special forms” called “special expressions” instead? I’ve been curious about this for some time. Would really appreciate being pointed towards some resources that might explain the origin of the word choice.
@odie https://stackoverflow.com/questions/17206657/are-lisp-forms-and-lisp-expressions-same-thing
Although that's the technical definition, I think most people use them interchangeably.
@tbaldridge thanks for that! So a “form” actually refers to the internal representation an interpreter has after the reader is done processing the expression?
yes, but if I saw one used in either situation I wouldn't bat an eye
Any idea why the word “form” was chosen? Is there some kind of historic reason? Or maybe a reason rooted in a field outside of CS? Just an interesting word choice if it’s actually referring to an AST.
ast nodes generally have a bit more information and overhead that the single value. A leaf node might just essentially be the value 1
but that's a pretty bare representation
A AST normally contains a bunch of compiler metadata in addition to the form itself.
Yeah, what @dpsutton said
brandon bloom has a playground for evaluators, ast,s etc at https://github.com/brandonbloom/kovasir
you can see what an ast for 1
looks like in his simple example:
{:op :const, :value 1}
and a more complicated form:
(let [x 1 y 2] (+ x y))
{:op :let,
:name x,
:init {:op :const, :value 1},
:expr {:op :let,
:name y,
:init {:op :const, :value 2},
:expr {:op :call,
:f {:op :ref, :name +},
:args [{:op :ref, :name x} {:op :ref, :name y}]}}}
@odie You made me curious. McCarthy credits Alonzo Church with coining the term “form” in 1941 (!) to distinguish from a “function.” Check out part (c) of page 6 of this paper: http://www-formal.stanford.edu/jmc/recursive.pdf