David Wall wrote:
> Rob Dixon wrote:
>
> > Lexical variables are another matter, as they don't belong to a
> > given package but exist globally as long as there is a reference
> > to them. In my opinion this is a bit of a hack, but access can
> > be limited by creating data that is accessible only by
> > reference, so that code can reach that data only if it has been
> > given a reference to it.
>
> It doesn't seem like a hack to me; it lets you use closures.

Yes, I knew it would be controversial :)

But my problem with it is that it has the feel of an afterthought
(which it was - Perl never used to have lexical variables). A 'my'
declaration is too visually similar to an 'our' declaration when
it creates a completely different type of object. I have even more
hatred of C's 'static' language word, which is a comparable device
but does diferent things in different places.

All IMO.

> (cf http://www.wikipedia.org/wiki/Closure_(programming) )

Thanks David. I didn't know about this site, it's a useful link.

Cheers,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to