Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lispy Elixir

Lispy Elixir

Avatar for Patrick Gombert

Patrick Gombert

May 16, 2014
Tweet

More Decks by Patrick Gombert

Other Decks in Technology

Transcript

  1. Lisp crash course (LISt Processing) () ; data structure (f)

    ; data structure and executable code (1 2 3) ; data structure without executable code ! ; closure definition ! ; program returning 4
  2. Elixir is composable ; Higher order function ! ; Function

    returning a function ! equivalent to
  3. Homoiconicity - Code is represented as data (everything is a

    list in lisp) - The resulting structure is a form of Abstract Syntax Tree (+ ; Root Node (+ ; Child of Root 1 ; Leaf Node 2) ; Leaf Node (+ ; Child of Root 3 ; Leaf Node 4)) ; Leaf Node !
  4. … or lisp style macros! - Compile time (like parse-transform)

    ! - Homoiconic AST manipulation (like parse-transform) ! - Consistent AST (!!!)
  5. defmacro ! ! - all at compile time - quoted

    arguments - returning ASTs for the evaluation in the current module