M
Michele Dondi
This is Yet Another Humble Proposal... I am aware of the risks of
exposing possibly naive ideas like this, but I'm asking anyway.
I wonder wether forward declaring a sub in a lexical scope could be
made to let the actual sub access variables lexically scoped to it. In
other words if
{
my $u;
sub u;
}
# ...
sub u {
$u;
}
could be made to be implicitly equivalent to
{
my $u;
sub u {
$u;
}
}
Of course this a priori depends on p5p and on technical details, but
what I'd like to know is wether you would judge such a semantic
disruptive of anything or potentially useful from the UI point of
view. I've been working on a program recently in which I would have
liked to put all the subs at the end, but with forward declarations at
the top, one of which like above. IMHO it would have marked clearly
the structure of the program.
Michele
exposing possibly naive ideas like this, but I'm asking anyway.
I wonder wether forward declaring a sub in a lexical scope could be
made to let the actual sub access variables lexically scoped to it. In
other words if
{
my $u;
sub u;
}
# ...
sub u {
$u;
}
could be made to be implicitly equivalent to
{
my $u;
sub u {
$u;
}
}
Of course this a priori depends on p5p and on technical details, but
what I'd like to know is wether you would judge such a semantic
disruptive of anything or potentially useful from the UI point of
view. I've been working on a program recently in which I would have
liked to put all the subs at the end, but with forward declarations at
the top, one of which like above. IMHO it would have marked clearly
the structure of the program.
Michele