lua-users home
lua-l archive

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


It was thus said that the Great steve donovan once stated:
> On Thu, Feb 27, 2014 at 1:57 AM, Sean Conner <sean@conman.org> wrote:
> > You can also write Lua in a functional style (you don't get lazy
> > evaluation, but neither do you have multiple inherentance), which I feel is
> > worth looking into.
> 
> Absolutely, and Javier would endorse this as well, I think. The
> mindblowingly powerful concept of "closures" = functions + bound state
> makes a lot of those awkward patterns very straightforward.

  Ah, I am reminded of this koan:

	The venerable master Qc Na was walking with his student, Anton. 
	Hoping to prompt the master into a discussion, Anton said "Master, I
	have heard that objects are a very good thing - is this true?" Qc Na
	looked pityingly at his student and replied, "Foolish pupil -
	objects are merely a poor man's closures."

	Chastised, Anton took his leave from his master and returned to his
	cell, intent on studying closures.  He carefully read the entire
	"Lambda: The Ultimate..." series of papers and its cousins, and
	implemented a small Scheme interpreter with a closure-based object
	system.  He learned much, and looked forward to informing his master
	of his progress.

	On his next walk with Qc Na, Anton attempted to impress his master
	by saying "Master, I have diligently studied the matter, and now
	understand that objects are truly a poor man's closures." Qc Na
	responded by hitting Anton with his stick, saying "When will you
	learn? Closures are a poor man's object." At that moment, Anton
	became enlightened.

  -spc (the sound of one hand typing ... )