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

Clojure's main rudiment: Macros - Construindo a fundação

Clojure's main rudiment: Macros - Construindo a fundação

Uma visão abrangente e conceitual sobre Macros em Clojure.

Tomás Augusto Müller

August 06, 2016
Tweet

Other Decks in Programming

Transcript

  1. Clojure's main
    rudiment: Macros
    Construindo a fundação

    View full-size slide

  2. “O código são dados!”

    View full-size slide

  3. “O código são dados!”

    View full-size slide

  4. Hands-on 1/3

    View full-size slide

  5. Sistema de avaliação em linguagens não-Lisp
    Fonte: Brave Clojure

    View full-size slide

  6. List’s -> Tree’s
    Fonte: Brave Clojure

    View full-size slide

  7. Sistema de avaliação em Clojure
    Fonte: Brave Clojure

    View full-size slide

  8. Recapitulando!
    • Reader
    • Reader Macros
    • (hands-on 2/3)
    • Evaluator
    • Symbols
    • Special-forms

    View full-size slide

  9. Clojure Macros

    View full-size slide

  10. Sistema de avaliação em Clojure
    Fonte: Brave Clojure

    View full-size slide

  11. Hands-on 3/3

    View full-size slide

  12. –Rich Hickey
    (http://codequarterly.com/2011/rich-hickey/)
    “You can reach a point with Lisp where,
    between the conceptual simplicity, the large
    libraries, and the customization of macros, you
    are able to write only code that matters. And,
    once there, you are able to achieve a very high
    degree of focus, such as you would when
    playing Go, or playing a musical instrument, or
    meditating. And then, as with those activities,
    there can be a feeling of elation that
    accompanies that mental state of focus.”

    View full-size slide