Skip to content

Instantly share code, notes, and snippets.

@hindenbug
Created January 4, 2014 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hindenbug/8259898 to your computer and use it in GitHub Desktop.
Save hindenbug/8259898 to your computer and use it in GitHub Desktop.
;; eg: symbols in clojure, points to a verb or other values
;; when clojure evaluates a symbol it looks up that symbols meaning
inc
;; refer to symbols without evaluating its meaning
;; ' escapes a expression. Quote anything and get it back exactly
;; the same
'inc
'"foo"
;; LISTS, surrounded by parantheses, LISP stood for LISt Processsing
;; List contain anything numbers, strings and even other lists
'(1 2 3)
'(nil "hi")
'(1 (2 (3 ())))
;; combining symbols an number as list
'(inc 0)
;; Removing the ' evaluates the expression
(inc 0)
;; A sentence in LISP is a list
;; Every list starts with a verb and followed by zero or more objects to act on
;; Parts of list are evaluates left to right
;; Innermost List are evaluates before outer lists
(inc (inc 0))
(+ 1 (- 2 6) (- 6 7))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment