Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Variable scope in Javascript driving me nuts



On 2010-08-29 01:26, Stephen J. Turnbull wrote:
> Josh Glover writes:
> 
>  > This is a related question for a language nerd: does Javascript
>  > have closures at all? If anonymous functions are not the way to
>  > create a closure, what is?
> 
> http://en.wikipedia.org/wiki/Closure_%28computer_science%29#JavaScript

There's also http://howtonode.org/why-use-closure

I've been doing a fair bit of Javascript[1] lately, and am rather fond
of anonymous functions[2].  Especially when building infrastructure
for others to build on, they are another tool to avoid polluting the
namespace.

Jim


[1]  I've found Node.js way easier to deal with than Python's Twisted,
although that may just be the relief of avoiding Twisted's annoying
nomenclature.

[2] But then my Python probably has way too many lambdas in it.  Blame
my upbringing.  At least Clojure is making it trendy to admit to
having Lisp as your first language.

-- 
Jim Tittsler  7J1AJH/ZL2IA/AI8A  Te Anau, NZ        GPG: 0x01159DB6
Kanto Computer Calendar  http://OnJapan.net/calendar/
Python Starship          http://Starship.Python.net/



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links