Re: Eliminate dynamic variables entirely?

2000-08-17 Thread J. David Blackstone
> [EMAIL PROTECTED] (Nathan Wiger) wrote on 14.08.00 in > <[EMAIL PROTECTED]>: > >> Well, lexical variables don't belong to any package in Perl. They're not >> in the symbol table, hence why others can't mess with them. That's why a >> "my $var" is different from a "$pkg::var". The latter gets i

Re: Eliminate dynamic variables entirely?

2000-08-17 Thread J. David Blackstone
>> Furthermore, in the "more rope" department, it might be possible to make >> local() work on my() variables this way. > > I'm still unsure if this is a good thing. I think it is, but it's worth > some pondering. > > -Nate > In the programming languages class I took last year, we wrote an inte

Re: Eliminate dynamic variables entirely?

2000-08-16 Thread Nathan Wiger
Kai Henningsen wrote: > > 1. Package variables $package::var, presumably you'd have to declare those > and the default would be > 2. lexical variables, Not bad, but I think #1 violates Laziness if I hear you right. Let's add a "global" or "your" keyword to do this inside a package: package M

Re: Eliminate dynamic variables entirely?

2000-08-15 Thread Kai Henningsen
[EMAIL PROTECTED] (Nathan Wiger) wrote on 14.08.00 in <[EMAIL PROTECTED]>: > Well, lexical variables don't belong to any package in Perl. They're not > in the symbol table, hence why others can't mess with them. That's why a > "my $var" is different from a "$pkg::var". The latter gets in the sym

Re: Eliminate dynamic variables entirely?

2000-08-14 Thread J. David Blackstone
>> I'll be submitting the RFC to the librarian as usual, but sending it >> to this list as well to allow for immediate follow-up. Our deadline >> is fast approaching. >> >> Rushed, >> J. David > > Naw, I wouldn't worry about this. Email Kirrily and ask for an > extension. That's what I did for

Re: Eliminate dynamic variables entirely?

2000-08-14 Thread Nathan Wiger
> I'll be submitting the RFC to the librarian as usual, but sending it > to this list as well to allow for immediate follow-up. Our deadline > is fast approaching. > > Rushed, > J. David Naw, I wouldn't worry about this. Email Kirrily and ask for an extension. That's what I did for -io. Let's

Re: Eliminate dynamic variables entirely?

2000-08-14 Thread J. David Blackstone
>> *) Lexical variables belong to the package they are declared in. (Or, >> if not declared, the package to which they belong can be inferred.) > > Well, lexical variables don't belong to any package in Perl. They're not > in the symbol table, hence why others can't mess with them. That's why a >

Re: Eliminate dynamic variables entirely?

2000-08-14 Thread Nathan Wiger
> how is "your" different from "our"? > > use MyPackage; > our $DEBUG=1; There's a very subtle difference in the way symbol tables are maintained. our() doesn't actually put the variable in the symbol table directly. The basic difference between your() and our() would be: our() = package wi

Re: Eliminate dynamic variables entirely?

2000-08-14 Thread ___cliff rayman___
Nathan Wiger wrote: > > However, make lexicals the default so that MyPackage would have to look > like this: > >package MyPackage; > ># my is redundant since lexicals are default >my($internal1, $internal2) = ('value1', 'value2'); > ># have to use your to give this variable to oth

Re: Eliminate dynamic variables entirely?

2000-08-14 Thread Nathan Wiger
> *) Lexical variables belong to the package they are declared in. (Or, > if not declared, the package to which they belong can be inferred.) Well, lexical variables don't belong to any package in Perl. They're not in the symbol table, hence why others can't mess with them. That's why a "my $var

Eliminate dynamic variables entirely?

2000-08-14 Thread J. David Blackstone
Here's a radical thought: In most languages, dynamic scoping of variables offers no advantages over lexical scoping, other than dynamic assignment. Dynamic assignment can be accomplished with the local() operator (soon to be renamed, I hope). The local() operator can be extended to operate