[Chicago-talk] Script comments

Steven Lembark lembark at wrkhors.com
Wed Jan 18 10:48:57 PST 2006


> I've actually wondered for some time what to call variables 'way up at
> the top' and outside of braces/loops/etc, really, the ones up in main.
> 
> And I should probably get used to calling them lexicals as well since
> that's really what they are.

Anything with a "my" in front of it is a lexical variable.

[Which is why most of the subroutines most people write most
of the time are closures :-].

Because their lifespan is longer than it takes to execute
a block, people have various names for the lexicals that
live in the file scope. The difference is not one of
scope (they are lexicals and the same rules apply to them
wherever they are) but lifetime: lexicals enclosed in
explicit blocks (say, a for loop) have a different lifetime
than file-scoped ones.


-- 
Steven Lembark                                       85-09 90th Street
Workhorse Computing                                Woodhaven, NY 11421
lembark at wrkhors.com                                     1 888 359 3508


More information about the Chicago-talk mailing list