Buddha Buck writes:
: We have
: while (foo()) -> $a {...}
: doing the right thing.
Well, C does that currently, not C, 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 implicit
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
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 wi
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.
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 optim
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 c
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
> > >t
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 bra
>>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 muc
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 th
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.
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 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 = <$
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 h
Michael G Schwern <[EMAIL PROTECTED]> 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 ick
Graham Barr wrote:
> On Mon, Jan 21, 2002 at 03:58:49PM -0500, Michael G Schwern wrote:
Case 1:
> > do {
> > if my $foo = bar() {
> > ...
> > }
> > }
Case 2:
> if ((my $foo = bar()) eq 'foo') {
> ...
> }
>
> if ($foo eq 'bar') {
> ...
> }
Des
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
> : > :
>
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 h
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 = {
: > : ...
: > : }
: > : elsif my $two = {
: > :
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
> "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 = ) {
>> > : ...
>> > : }
>> >
>> > That still works fine--it's jus
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?
{
Michael G Schwern writes:
: In this case I'll take long-term simplicity over short-term
: easy-to-explain rules.
I fail to see what's simpler about it.
: Otherwise we'll be writing this all over the
: place til Kingdom come.
:
: do {
: if my $foo = bar() {
: ...
:
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 = {
> : ...
> : }
> : elsif my $two = {
> : }
> :
> : if ($two) {
> : ...
> :
Graham Barr writes:
: But are we not at risk of introducing another form of
:
: my $x if 0;
:
: with
:
: if my $one = {
: ...
: }
: elsif my $two = {
: }
:
: if ($two) {
: ...
: }
Then it's just undefined. It's no different from how &&, ||, or ??::
work when you put a
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 s
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
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++
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,
> > not before and not after. I don't see ickyness about making that s
David Whipp writes:
: 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.
:
: Perl is well known for its non-or
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 l
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>;
>
Ted Ashton writes:
: 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 = ) {
: > > : ...
: > > : }
: > >
: > > That still works fine--it's just that $line lives on after the while.
: >
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.
Perl is well known for its non-orthogonality. To say that "A bloc
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,
> not before and not after. I don't see ickyness about making that so.
Exactly!
What we're cleaning up is the ickiness of having things dec
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 = ) {
> > : ...
> > : }
> >
> > That still works fine--it's just that $line lives on after the while.
>
> This creeping lexical leakage bothers me. W
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 = ) {
:> > : ...
:> > : }
:> >
:> > That still works fine--it's just that
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 = ) {
> > : ...
> > : }
> >
> > That still works fine--it's just that $line lives on after the while.
>
> This creeping lexical leakage bo
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 W
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:
> >> : while( my $line = ) {
> >> : ...
> >> : }
> >>
> >> That still works fine--it's just that $li
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 = ) {
> > : ...
> > : }
> >
> > That still works fine--it's just that $line lives on after the while.
>
>This creeping lexical leakage bothers m
On Sun, Jan 20, 2002 at 10:58:34PM -0800, Larry Wall wrote:
> : while( my $line = ) {
> : ...
> : }
>
> That still works fine--it's just that $line lives on after the while.
This creeping lexical leakage bothers me. While it might make the
language simpler, the proliferation of
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 C or C. The new rule is that
: > to be lexical to a block it has to be declared in the block, or in
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 C or C. 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.
>
> Y
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
"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?
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' constr
47 matches
Mail list logo