Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Re: (On Speed Diff, etc.) Closure on Closures (beta)

by yosefm (Friar)
on Jun 26, 2003 at 08:48 UTC ( #269154=note: print w/replies, xml ) Need Help??

in reply to Re: (On Speed Diff, etc.) Closure on Closures (beta)
in thread Closure on Closures

I've seen objects actually implemented with a closure (like in this tutorial), as a way to give your objects a 'private/public' distinction. I wonder what would that do to performance...
  • Comment on Re: Re: (On Speed Diff, etc.) Closure on Closures (beta)

Replies are listed 'Best First'.
Re: Re: Re: (On Speed Diff, etc.) Closure on Closures (beta)
by chunlou (Curate) on Jun 26, 2003 at 09:52 UTC
    Right, that's a very clever use of closure. Maybe I didn't read enough, but I don't see such technique being used too often. It's good for avoiding more deliberate tempering with variables in a package. Isn't the usual lexical scope good enough to avoid accidental clashes between things?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://269154]
[ambrus]: choroba: heh heh... I have such a doc bug report somewhere. fixed by now.
[Corion]: Once upon a time I had automatic tests for checking the synopsis, but I stopped doing that because the setup was too fragile on CPAN testers for extracting code from the SYNOPSIS.
[Corion]: Maybe I should move the extraction of the code from the SYNOPSIS section into the author tests, or something like that...
[choroba]: Corion Sounds reasonable

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-02-27 12:10 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (383 votes). Check out past polls.