Skip to content

Instantly share code, notes, and snippets.

@jaseemabid
Last active February 29, 2016 18:42
Show Gist options
  • Select an option

  • Save jaseemabid/c8b78a9e72394e455cd7 to your computer and use it in GitHub Desktop.

Select an option

Save jaseemabid/c8b78a9e72394e455cd7 to your computer and use it in GitHub Desktop.
Slides of the talk "A micro manual for LISP - Not the whole truth"
* Hello!
I'm Jaseem Abid
2009 - '13 Batch
@jaseemabid
gh/jaseemabid
* A micro manual for LISP - Not the whole truth
* LISP
* "Uncle" John McCarthy
* LOTS OF SILLY PARENTHESIS
#+BEGIN_SRC clojure
(clojure.core/equiv
[this__6437__auto__ G__1329]
(clojure.core/boolean
(clojure.core/or
(clojure.core/identical? this__6437__auto__ G__1329)
(clojure.core/when
(clojure.core/identical?
(clojure.core/class this__6437__auto__)
(clojure.core/class G__1329))
(clojure.core/let
[G__1329 G__1329]
(clojure.core/and
(clojure.core/= name (. G__1329 -name))
(clojure.core/= __extmap (. G__1329 __extmap))))))))
#+END_SRC
* But it's not not just that!
- Code == Data
- Meta programming, aka Macros
- Control flows. Laziness, Continuations
- Ubiquitous
* Today's Agenda
* The Meta Circular evaluator
* Symbolic expressions, aka sexp
Atoms
#+BEGIN_SRC clojure
hello my_name T NIL
#+END_SRC
Lists
#+BEGIN_SRC clojure
(add 20 30)
(quote friends Merry Pippin Sam)
#+END_SRC
* 10 rules to bind them!
* 1. QUOTE
#+BEGIN_SRC clojure
(quote "Hello World")
'("Hello World")
#+END_SRC
* 2. CAR
#+BEGIN_SRC clojure
==> (car '(one two three))
one
#+END_SRC
* 3. CDR
#+BEGIN_SRC clojure
==> (cdr '(one two three))
(two three)
#+END_SRC
* 4. CONS
#+BEGIN_SRC clojure
==> (cons 'one '(ring to bind them))
(one ring to bind them)
#+END_SRC
* 5. EQUAL
#+BEGIN_SRC clojure
==> (equal 'one (car '(one two theee)))
T
==> (equal 'hello 'world)
NIL
#+END_SRC
* 6. ATOM
#+BEGIN_SRC clojure
==> (atom 'hello)
T
==> (atom 42)
NIL
#+END_SRC
* 7. COND
#+BEGIN_SRC clojure
(cond
((< n 0) "negative")
((> n 0) "positive"))
#+END_SRC
* 8. VARIABLES
#+BEGIN_SRC clojure
pi
#+END_SRC
* 9. LAMBDA
#+BEGIN_SRC clojure
(lambda (n)
(cond
((< n 0) "negative")
((> n 0) "positive")))
#+END_SRC
* 10. LABELS, The hard one!
Substitution
* Pre defined functions
list, null, cadr
* The evaluator
* Not the whole truth
* References
- The paper, http://www.ee.ryerson.ca/~elf/pub/misc/micromanualLISP.pdf
- PWL Bangalore, http://www.meetup.com/Papers-we-love-Bangalore/events/196358812/
- https://news.ycombinator.com/item?id=1591112
* Thank you!
* Oh. some more!
* PapersWeLove.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment