>>>>> ""Mr" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes:

Mr> Objects can do the same things as closures, which is store and hide data,
Mr> but don't have this problem of having to keep in mind two phases of the
Mr> same code.

But objects have fixed code with variable data.  Closures can have variable
code with variable data, including user-specified behavior passed in to a
constructor or a mutator.  So, yes, objects can do *some* of the things that
closures do, but not all.

Think of closures as "variables that hold behavior".  Sure, maybe you've never
needed that in your legendary 25 years in the industry, but I've used it
*frequently* in my 30 years. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to