On Sun, Jan 27, 2002 at 10:43:08PM -, Rafael Garcia-Suarez wrote:
Melvin Smith wrote in perl6-language:
Besides no one has commented on Steve Fink's (I think it was him) idea
to store the result of the most recently executed conditional in $?. I
kinda like that idea myself. It makes
On Mon, Jan 28, 2002 at 09:56:03AM -0800, Steve Fink wrote:
Allowing $? would eliminate having any different behavior from boolean
vs scalar context, and that seems like a potentially bad idea. (And I
really don't like the idea of behavior changing based on the addition
of a $? way down
On Fri, Jan 25, 2002 at 11:31:13PM -0500, Melvin Smith wrote:
At 11:40 AM 1/25/2002 -0600, Jonathan Scott Duff wrote:
On Fri, Jan 25, 2002 at 11:57:25AM +0100, Bart Lateur wrote:
On Mon, 21 Jan 2002 15:43:07 -0500, Damian Conway wrote:
What we're cleaning up is the ickiness of having
Buddha Buck writes:
: We have
: while (foo()) - $a {...}
: doing the right thing.
Well, Cfor does that currently, not Cwhile, but...
: Why can't
:
: if foo() - $a { ... }
:
: take the place of the perl5
:
: if (my $a = foo()) {...}
I'd do something explicit like -$a before I'd do some
Melvin Smith wrote in perl6-language:
Besides no one has commented on Steve Fink's (I think it was him) idea
to store the result of the most recently executed conditional in $?. I
kinda like that idea myself. It makes mnemonic sense.
I like the $? idea, and it could probably be optimized
In article [EMAIL PROTECTED], [EMAIL PROTECTED]
(Jonathan Scott Duff) wrote:
On Fri, Jan 25, 2002 at 11:57:25AM +0100, Bart Lateur wrote:
On Mon, 21 Jan 2002 15:43:07 -0500, Damian Conway wrote:
What we're cleaning up is the ickiness of having things declared
outside
the braces be
On Fri, Jan 25, 2002 at 12:50:51PM -0800, Erik Steven Harrison wrote:
Besides no one has commented on Steve Fink's (I think it was him) idea
to store the result of the most recently executed conditional in $?. I
kinda like that idea myself. It makes mnemonic sense.
H . . . I could grow
On Mon, Jan 21, 2002 at 12:50:38PM -0800, Larry Wall wrote:
In most other languages, you wouldn't even have the opportunity to put
a declaration into the conditional. You'd have to say something like:
my $line = $in;
if $line ne { ... }
Since
if my $line = $in { ... }
On Mon, 21 Jan 2002 15:43:07 -0500, Damian Conway wrote:
What we're cleaning up is the ickiness of having things declared outside
the braces be lexical to the braces. *That's* hard to explain to beginners.
But it's handy. And that was, until now, what mattered with Perl.
--
Bart.
On Fri, Jan 25, 2002 at 11:57:25AM +0100, Bart Lateur wrote:
On Mon, 21 Jan 2002 15:43:07 -0500, Damian Conway wrote:
What we're cleaning up is the ickiness of having things declared outside
the braces be lexical to the braces. *That's* hard to explain to beginners.
But it's handy. And
At 11:40 AM 01-25-2002 -0600, Jonathan Scott Duff you wrote:
On Fri, Jan 25, 2002 at 11:57:25AM +0100, Bart Lateur wrote:
On Mon, 21 Jan 2002 15:43:07 -0500, Damian Conway wrote:
What we're cleaning up is the ickiness of having things declared outside
the braces be lexical to the braces.
Besides no one has commented on Steve Fink's (I think it was him) idea
to store the result of the most recently executed conditional in $?. I
kinda like that idea myself. It makes mnemonic sense.
H . . . I could grow used to that. A couple of thoughts.
1) It doesn't seem to buy us much
At 11:40 AM 1/25/2002 -0600, Jonathan Scott Duff wrote:
On Fri, Jan 25, 2002 at 11:57:25AM +0100, Bart Lateur wrote:
On Mon, 21 Jan 2002 15:43:07 -0500, Damian Conway wrote:
What we're cleaning up is the ickiness of having things declared outside
the braces be lexical to the braces.
Michael G Schwern [EMAIL PROTECTED] writes:
On Mon, Jan 21, 2002 at 03:02:06PM -0500, Tzadik Vanderhoof wrote:
Why all the fuss? Often, you would *want* to access that lexical after the
loop terminates, for instance to check how it terminated.
In most cases you don't want that to happen,
At 12:32 PM 1/21/2002 -0500, Michael G Schwern wrote:
On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote:
: while( my $line = FILE ) {
: ...
: }
That still works fine--it's just that $line lives on after the while.
This creeping lexical leakage bothers me.
Conway; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: Night of the Living Lexical (sequel to Apoc4: The loop
keyword)
On Mon, Jan 21, 2002 at 02:44:40PM -0500, Melvin Smith wrote:
At 12:32 PM 1/21/2002 -0500, Michael G Schwern wrote:
On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote
Thus it was written in the epistle of Michael G Schwern,
On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote:
: while( my $line = FILE ) {
: ...
: }
That still works fine--it's just that $line lives on after the while.
This creeping lexical leakage bothers
On Mon, Jan 21, 2002 at 03:26:30PM -0500, Ted Ashton wrote:
:
:Thus it was written in the epistle of Michael G Schwern,
: On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote:
: : while( my $line = FILE ) {
: : ...
: : }
:
: That still works fine--it's just that $line
On 2002.01.21 18:32 Michael G Schwern wrote:
On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote:
: while( my $line = FILE ) {
: ...
: }
That still works fine--it's just that $line lives on after the while.
This creeping lexical leakage bothers me. While it
On Mon, Jan 21, 2002 at 12:50:38PM -0800, Larry Wall wrote:
: What's the chance that it could be considered so?
In most other languages, you wouldn't even have the opportunity to put
a declaration into the conditional. You'd have to say something like:
my $line = $in;
if $line
On Mon, Jan 21, 2002 at 03:27:29PM -0500, Casey West wrote:
So you're suggesting that we fake lexical scoping? That sounds more
icky than sticking to true lexical scoping. A block dictates scope,
not before and not after. I don't see ickyness about making that
so.
Perl5 already fakes
At 12:50 PM 1/21/2002 -0800, Larry Wall wrote:
In most other languages, you wouldn't even have the opportunity to put
a declaration into the conditional. You'd have to say something like:
I grudgingly agree here. Where did this shorthand come from anyway?
The first time I ever used it was C++
Michael G Schwern writes:
: On Mon, Jan 21, 2002 at 03:27:29PM -0500, Casey West wrote:
: So you're suggesting that we fake lexical scoping? That sounds more
: icky than sticking to true lexical scoping. A block dictates scope,
: not before and not after. I don't see ickyness about making
On Mon, Jan 21, 2002 at 03:58:49PM -0500, Michael G Schwern wrote:
On Mon, Jan 21, 2002 at 03:43:07PM -0500, Damian Conway wrote:
Casey wrote:
So you're suggesting that we fake lexical scoping? That sounds more
icky than sticking to true lexical scoping. A block dictates scope,
On Mon, Jan 21, 2002 at 01:01:09PM -0800, Larry Wall wrote:
Graham Barr writes:
: But are we not at risk of introducing another form of
:
: my $x if 0;
:
: with
:
: if my $one = ONE {
: ...
: }
: elsif my $two = TWO {
: }
:
: if ($two) {
: ...
: }
Then
Graham Barr wrote:
But I have lost count of the number
of times I have wanted to do
if ((my $foo = bar()) eq 'foo') {
...
}
if ($foo eq 'bar') {
...
}
To be contrasted with:
while (my($k, $v) = each %h1)
{
...
}
while (my($k, $v) = each %h2) # error?
{
...
}
MS == Melvin Smith [EMAIL PROTECTED] writes:
MS At 12:32 PM 1/21/2002 -0500, Michael G Schwern wrote:
On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote:
: while( my $line = FILE ) {
: ...
: }
That still works fine--it's just that $line lives on
At 04:12 PM 1/21/2002 -0500, Uri Guttman wrote:
MS lives on, ... creeping lexical, I feel the same way, we must
find some
MS way to kill these... :)
well, larry looks at it differently and what he said on the cruise makes
Well we had a go, but our kung fu powers were no match for
Graham Barr writes:
: On Mon, Jan 21, 2002 at 01:01:09PM -0800, Larry Wall wrote:
: Graham Barr writes:
: : But are we not at risk of introducing another form of
: :
: : my $x if 0;
: :
: : with
: :
: : if my $one = ONE {
: : ...
: : }
: : elsif my $two = TWO {
: : }
Michael G Schwern wrote:
In this case I'll take long-term simplicity over short-term
easy-to-explain rules. Otherwise we'll be writing this all over the
place til Kingdom come.
do {
if my $foo = bar() {
...
}
}
I'm surprised no one else has
On Mon, Jan 21, 2002 at 01:38:39PM -0800, Larry Wall wrote:
Graham Barr writes:
: On Mon, Jan 21, 2002 at 01:01:09PM -0800, Larry Wall wrote:
: Graham Barr writes:
: : But are we not at risk of introducing another form of
: :
: : my $x if 0;
: :
: : with
: :
: : if my
Bryan C. Warnock wrote:
No examples are given, but are we to assume that this:
for ($x = 0; $x 100; $x++) {
...
}
becomes this:
loop $x=0; $x 100; $x++ {
...
}
Yes.
How would you use an $x lexically scoped to the loop block?
You
Damian Conway writes:
: Bryan C. Warnock wrote:
:
: No examples are given, but are we to assume that this:
:
: for ($x = 0; $x 100; $x++) {
: ...
: }
:
: becomes this:
:
: loop $x=0; $x 100; $x++ {
: ...
: }
:
: Yes.
:
:
: How would you use
On Sun, Jan 20, 2002 at 07:25:17PM -0500, Damian Conway wrote:
How would you use an $x lexically scoped to the loop block?
You can't...directly. Nor can a Cwhile or Cif. The new rule is that
to be lexical to a block it has to be declared in the block, or in the
block's parameter list.
Michael G Schwern writes:
: On Sun, Jan 20, 2002 at 07:25:17PM -0500, Damian Conway wrote:
: How would you use an $x lexically scoped to the loop block?
:
: You can't...directly. Nor can a Cwhile or Cif. The new rule is that
: to be lexical to a block it has to be declared in the block, or
No examples are given, but are we to assume that this:
for ($x = 0; $x 100; $x++) {
...
}
becomes this:
loop $x=0; $x 100; $x++ {
...
}
How would you use an $x lexically scoped to the loop block?
Most of the other constructs seem to be using a '- $x'
36 matches
Mail list logo