Metaprogramming – Programs That Write Programs



Metaprogramming – Programs That Write Programs

0 0


metaprogramming-presentation

Metaprogramming presentation

On Github brettshollenberger / metaprogramming-presentation

Metaprogramming

Programs That Write Programs

Brett Cassette / @brettcassette

You look good today

it's dynamic! boogie-woogie-woogie

dynamic languages:

  • have no compile time
  • can reflect on themselves
  • can wait until the last possible second to add or call code

ghost methods

$ curl https://gist.githubusercontent.com/brettshollenberger/73792da058165250f66c/raw/a87dcbdcf9415767e1788821a120e74adc9672d4/gistfile1.rb > ~/example.rb && pry -r ~/example.rb && rm ~/example.rb

method missing

null object pattern with method missing

dynamic dispatch

dynamic dispatch

reflection

dynamic method

dynamic method

alias around method

alias method chain

Happy Hacking!

Brett Cassette / @brettcassette