On Mon, Nov 25, 2002 at 02:27:36PM -0800, Randal L. Schwartz wrote:
: > "Simon" == Simon Cozens <[EMAIL PROTECTED]> writes:
:
: Simon> What were the good reasons for not allowing localized lexicals in Perl 5?
:
: Nobody could explain it in 50 words or less.
:
: "What the hell is 'local my $f
I'm sorry, but I gotta get back on the
no-global grail trail for at least one
more post.
> The granularity [of currying] can be
> controlled on a sub-by-sub or on a
> class-by-class basis.
If one could do something like this:
{
my $src = 'oldname1';
my $dest = 'newname1';
use FileUt
Larry's earlier response means this 'yours'
idea is history, but for closure, yes, this
seems to be headed in the right direction,
at least in theory. It may have even been
practical to implement it thru the standard
property mechanism.
> so these two are equivalent ???
>
> {
> my $x is yours ;
>
> "Simon" == Simon Cozens <[EMAIL PROTECTED]> writes:
Simon> What were the good reasons for not allowing localized lexicals in Perl 5?
Nobody could explain it in 50 words or less.
"What the hell is 'local my $foo = 35'?"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
Thanks for the clear answers.
Larry:
> I think that currying should be extended to
> handle any caller-instituted defaulting.
Argh. So obvious! (So of course I missed it.)
> Basically, the parameter list of the subroutine
> is already providing a limited namespace to be
> shared by caller and c
[EMAIL PROTECTED] (Larry Wall) writes:
> :It can also make sense if it is lexical.
> :Is the latter currently allowed?
>
> I'm planning to allow it unless someone can come up with a good reason not to.
What were the good reasons for not allowing localized lexicals in Perl 5?
--
User:
On Sat, Nov 23, 2002 at 08:46:03PM -0600, Me wrote:
: First, I'd like to confirm I've understood
: C and C right:
:
: 1. C dynamically scopes changes to a
:variable's value to the enclosing block.
:It does not dynamically scope the name.
:The variable can obviously be a global.
:It
so these two are equivalent ???
{
my $x is yours ;
my $y is yours ;
my $z is yours ;
1...
sub_a ;
2...
}
sub sub_a ( ; $x is yours, $y is yours ) { ...3... } ;
- same as -
# ( here no special meaning for "is yours" -- just another property )
Warning: I just watched The Wizard Of Oz
for the first time tonight.
> $x is yours
>
> tells that $x is aliased to variable in
> some "secret scope symbol table" that
>( the table ) is shared between caller
> and callee
The "secret" place is MyYourca, a Subterranean
island. People think it's an
Me writes:
>
> 4. Autoargs are conceptually simpler than
> shared variables, for both newbies and
> experts. But clearly this is subjective. :>
>
thats exactly the point where I tryed to improve. Think of me as a
newbe ( which I am ) -- If I understand your proposal , I can explain it to
> I like more "shared" instead of "yours"
But that's because that's the way you are
thinking about the problem/solution.
I'm just talking about a very local trick
of having autoargs instead of explicitly
passing args in parens. The fact that this
ends up creating an elegant alternative to
dangero
> you propose a mechanism of passing [vars]
> between desired subroutins by default
> through all the dynamical chain of sub
> calls "connecting them.
There's more, or rather, less to it than that.
The same mechanism also includes a clean way
to pass "it", something that needs to be done.
And a
I think , ( on the second reading of your post ) , that your proposal
of "my $x is yours" is logically very similar to my proposal of "our
$x is shared" but your proposal is cleaner if I understand it as
follows ( although I like more "shared" instead of "yours" for that
purpose ) : instead of ali
If I misunderstood you -- correct me. It seems that all you worry
about is that you want some variable be seen in several subroutines
.. you propose a mechanism of passing them between desired subroutins
by default through all the dynamical chain of sub calls "connecting
them. It seems , on the
In summary, I am proposing that one marks
variables that are to be automatically
passed from sub to sub with 'is yours'
where appropriate.
An example of what I'm suggesting follows.
Code with brief comments first then explanation.
{
my $_; # $_ can't be touched
First, I'd like to confirm I've understood
C and C right:
1. C dynamically scopes changes to a
variable's value to the enclosing block.
It does not dynamically scope the name.
The variable can obviously be a global.
It can also make sense if it is lexical.
Is the latter currently al
> [temp]
> [implicit args]
Here's a snippet of conversation on a
haskell list about implementation of
implicit args : http://tinyurl.com/2ym1
--
ralph
First, I'd like to confirm I've understood
C and C right:
1. C dynamically scopes changes to a
variable's value to the enclosing block.
It does not dynamically scope the name.
The variable can obviously be a global.
It can also make sense if it is lexical.
Is the latter currently al
18 matches
Mail list logo