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

(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))))))))

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

hello my_name T NIL

Lists

(add 20 30)

(quote friends Merry Pippin Sam)

10 rules to bind them!

1. QUOTE

(quote "Hello World")

'("Hello World")

2. CAR

==> (car '(one two three))

one

3. CDR

==> (cdr '(one two three))

(two three)

4. CONS

==> (cons 'one '(ring to bind them))

(one ring to bind them)

5. EQUAL

==> (equal 'one (car '(one two theee)))
T

==> (equal 'hello 'world)
NIL

6. ATOM

==> (atom 'hello)

T

==> (atom 42)

NIL

7. COND

(cond
  ((< n 0) "negative")
  ((> n 0) "positive"))

8. VARIABLES

pi

9. LAMBDA

(lambda (n)
  (cond
    ((< n 0) "negative")
    ((> n 0) "positive")))

10. LABELS, The hard one!

Substitution

Pre defined functions

list, null, cadr

The evaluator

Not the whole truth

References

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