Skip to content

Instantly share code, notes, and snippets.

@neektza
Created August 6, 2012 21:26
Show Gist options
  • Save neektza/3278569 to your computer and use it in GitHub Desktop.
Save neektza/3278569 to your computer and use it in GitHub Desktop.
A terminology suggestion

At...

Why are we using anonymous module here? Because we want to stay in the same context, so we can use the prepend variable.

and...

prepend doesn’t exist in the context of the new method, since it’s a local variable. We have to define a method dynamically to use it.

.. maybe better to mention that by defining the module and the method in a block, we stay in the same lexical [closure](http://en.wikipedia.org/wiki/Closure_(computer_science\)), and in that way we can access the local variables. What I'm trying to say is that we don't need to define these things anonymously or dynamically; we just need to define them in a the same lexical closure, and we achieve that by using blocks.

\o\

@shime
Copy link

shime commented Aug 6, 2012

Thank you, nice one. Agreed completely. I'll add your note. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment