Hi,
I would like to propose adding the last statement
to the grep, which currently doesn't work:
maas34: perl -e 'grep { print and $_ == 3 and last } (1,2,3,4,5)'
123
Can't last outside a loop block at -e line 1.
This way it would be possible to use such constructs:
print_header
On Wed, May 02, 2001 at 11:13:13AM +0200, Alexander Farber (EED) wrote:
I would like to propose adding the last statement
to the grep, which currently doesn't work:
For the record, I have no problem with this. :)
maas34: perl -e 'grep { print and $_ == 3 and last } (1,2,3,4,5)'
123
On Wed, May 02, 2001 at 11:10:22AM +0100, Michael G Schwern wrote:
On Wed, May 02, 2001 at 11:13:13AM +0200, Alexander Farber (EED) wrote:
I would like to propose adding the last statement
to the grep, which currently doesn't work:
For the record, I have no problem with this. :)
Michael G Schwern wrote:
And I'm quite sure there's an RFC for doing something like this alread
up for Perl 6.
At least RFC 199, and several related threads
such as $a in @b.
--
John Porter
It's so mysterious, the land of tears.
Michael G Schwern writes:
: (grep {...} @stuff)[0] will work, but its inelegant.
It's inelegant only because the slice doesn't know how to tell the
iterator it only needs one value. If it did know, you'd call it
elegant. :-)
Larry
I've been recently looking over the specification for C# and the .NET
platform (and falling for very little of the verbage: almost every line of
the first chapter of book I'm reading contains at least one oxymoron), and
am seeing some similarities between some of the proposed goals of Perl 6 and
On Wed, May 02, 2001 at 04:30:07PM +0100, Michael G Schwern wrote:
On Wed, May 02, 2001 at 08:05:29AM -0700, Larry Wall wrote:
Michael G Schwern writes:
: (grep {...} @stuff)[0] will work, but its inelegant.
It's inelegant only because the slice doesn't know how to tell the
iterator
GB == Graham Barr [EMAIL PROTECTED] writes:
GB On Wed, May 02, 2001 at 04:30:07PM +0100, Michael G Schwern wrote:
On Wed, May 02, 2001 at 08:05:29AM -0700, Larry Wall wrote:
Michael G Schwern writes:
: (grep {...} @stuff)[0] will work, but its inelegant.
It's inelegant
On Wed, May 02, 2001 at 12:01:24PM -0400, Uri Guttman wrote:
GB == Graham Barr [EMAIL PROTECTED] writes:
GB On Wed, May 02, 2001 at 04:30:07PM +0100, Michael G Schwern wrote:
On Wed, May 02, 2001 at 08:05:29AM -0700, Larry Wall wrote:
Michael G Schwern writes:
: (grep {...}
David Grove writes:
: Larry, et. al.: Is this similarity on purpose?
Yes, but only becase .NET is a VM, not because it's from MicroSoft.
The basic goal is to have a Perl VM that can sit easily on other VMs,
whether .NET's or Java's or our own. Another example of competing
by cooperating, which
On Wed, 2 May 2001 08:05:29 -0700 (PDT), Larry Wall [EMAIL PROTECTED] wrote:
Michael G Schwern writes:
: (grep {...} @stuff)[0] will work, but its inelegant.
It's inelegant only because the slice doesn't know how to tell the
iterator it only needs one value. If it did know, you'd call it
On Wed, May 02, 2001 at 06:05:54PM +0200, H. Merijn Brand wrote:
IIRC, that optimization is not even considered for reasons of many people
wanting the side effects of grep/map finishing over all elements (which could
of course be from a tied array or database connection)
If we could determine
On Wed, 2 May 2001 17:05:31 +0100, Graham Barr wrote:
wantarray-ness is already passed along the call stack today. Thats
the whole point of it. So what is the difference in passing a number
instead of a boolean ?
Because you might have a wantarray situation that expects no values?
() =
H.Merijn Brand writes:
: On Wed, 2 May 2001 08:05:29 -0700 (PDT), Larry Wall [EMAIL PROTECTED] wrote:
: Michael G Schwern writes:
: : (grep {...} @stuff)[0] will work, but its inelegant.
:
: It's inelegant only because the slice doesn't know how to tell the
: iterator it only needs one
On Wed, May 02, 2001 at 06:29:51PM +0200, Bart Lateur wrote:
On Wed, 2 May 2001 17:05:31 +0100, Graham Barr wrote:
wantarray-ness is already passed along the call stack today. Thats
the whole point of it. So what is the difference in passing a number
instead of a boolean ?
Because you
On Wed, May 02, 2001 at 05:36:11PM +0100, Graham Barr wrote:
On Wed, May 02, 2001 at 06:29:51PM +0200, Bart Lateur wrote:
On Wed, 2 May 2001 17:05:31 +0100, Graham Barr wrote:
wantarray-ness is already passed along the call stack today. Thats
the whole point of it. So what is the
At 09:29 AM 5/2/2001 -0700, Larry Wall wrote:
H.Merijn Brand writes:
: wanting the side effects of grep/map finishing over all elements (which
could
: of course be from a tied array or database connection)
If we do that kind of optimization, then we would certainly provide
some kind of easy
David Grove wrote:
am seeing some similarities between some of the proposed goals of
Perl 6 and the .NET platform.
. . . many things in .NET have been discussed similarly here.
That's because .NET attempts to address real-world issues.
The goals of .NET are not evil in and of themselves, you
Michael G Schwern wrote:
If we could determine if the block has no side effects... oh wait,
everything in Perl has a side effect. ;)
:pure (again!)
--
John Porter
Bart Lateur writes:
: Because you might have a wantarray situation that expects no values?
:
: () =3D whateveryouwant();
:
: You can always expect one more than is on the LHS.
:
: How is this currently handled with split()?
It fakes up a third argument that is one more than the length
Dan Sugalski writes:
: I'd really like to get into the details of what is and isn't valid for the
: optimizer to do, though I expect it's still a little early in the
: Apocalypse season for that.
Doubtless we'll do as other compilers do, and have a little knob you
just keep turning up until
At 09:58 AM 5/2/2001 -0700, Larry Wall wrote:
Dan Sugalski writes:
: I'd really like to get into the details of what is and isn't valid for the
: optimizer to do, though I expect it's still a little early in the
: Apocalypse season for that.
Doubtless we'll do as other compilers do, and have a
DS == Dan Sugalski [EMAIL PROTECTED] writes:
DS I've mumbled about it on and off. I'd like to be able to do:
DS$foo = new Bar;
DSprint SOCKET serialze($foo);
DS and on the other end do:
DS$foo = unserialize(SOCKET);
DS$foo-bar();
DS I don't know that much has
Dan Sugalski wrote:
I'd like to be able to do:
$foo = new Bar;
print SOCKET serialze($foo);
and on the other end do:
$foo = unserialize(SOCKET);
$foo-bar();
I personally am a big fan of Obliq semantics.
It's something I'd really like to see in perl.
--
John Porter
It's so
On Wed, 2 May 2001 11:41:32 -0500, Jarkko Hietaniemi wrote:
but I suspect in this case want('LIST') would
return that magical 0 but true or something similar.
Hopefully the something similar, I hope in Perl 6 we will able to
bury the 0 but true workaround to the backyard on a moonless night
Taking a page from JavaScript, it would be nice in the same vein to be
able to access the context (stack frame type context, not scalar/list
type context) of a method, either running or not.
The idea is that if the information was available, a module could start
multiple threads, spawn them
DS At 12:54 PM 5/2/2001 -0400, John Porter wrote:
David Grove wrote:
distributed objects,
I don't recall discussion of this wrt perl6, frankly.
DS I've mumbled about it on and off. I'd like to be able to do:
DS$foo = new Bar;
DSprint SOCKET serialze($foo);
DS and on the other
At 09:30 PM 5/2/2001 +0400, Ilya Martynov wrote:
DS At 12:54 PM 5/2/2001 -0400, John Porter wrote:
David Grove wrote:
distributed objects,
I don't recall discussion of this wrt perl6, frankly.
DS I've mumbled about it on and off. I'd like to be able to do:
DS$foo = new Bar;
DS
Because you might have a wantarray situation that expects no values?
() = whateveryouwant();
I am sure that situation is handled by the 'want' RFC.
Yep. The most recent version is at:
http://www.yetanother.org/damian/Perl5+i/want.html
I have not read it
Hopefully the something similar, I hope in Perl 6 we will able to
bury the 0 but true workaround to the backyard on a moonless night :-)
Especially since you don't need it. 0E0 and 0., to name just two,
work just as well. ;-)
At 06:06 AM 5/3/2001 +1000, Damian Conway wrote:
Hopefully the something similar, I hope in Perl 6 we will able to
bury the 0 but true workaround to the backyard on a moonless
night :-)
Especially since you don't need it. 0E0 and 0., to name just two,
work just as well.
am seeing some similarities between some of the proposed goals of
Perl 6 and the .NET platform.
. . . many things in .NET have been discussed similarly here.
That's because .NET attempts to address real-world issues.
The goals of .NET are not evil in and of themselves, you know.
Depends
On Wed, May 02, 2001 at 05:22:26PM -0400, David Grove wrote:
am seeing some similarities between some of the proposed goals of
Perl 6 and the .NET platform.
. . . many things in .NET have been discussed similarly here.
That's because .NET attempts to address real-world issues.
The
-Original Message-
From: Jarkko Hietaniemi [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 5:26 PM
To: David Grove
Cc: Perl 6 Language Mailing List
Subject: Re: .NET
(still waiting
for something original for a change).
You are saying that the Clippy wasn't
Actually, Clippy is definitely worth stealing. In fact, the whole
notion of Generalized Robotic Open-source Animated Cartoon Images
(GROACI) is imperative to the future of perl.
Forget many-languages-one-engine, Larry, and focus on winning the
Groaci race...
/HUMOR
=Austin
--- David Grove
Graham Barr wrote:
How this cooperates with lazy is a different matter entirely.
Graham.
http://dev.perl.org/rfc/123.html#Assigning_from_lazy_lists
suggests that assigning to a sized busy array from a lazy array will
fill it and stop.
--
David Nicol 816.235.1187
Don't Let Architecture Astronauts Scare You
http://joel.editthispage.com/stories/storyReader$320
This is a really good article. The quotes from MS and Sun whitepapers are
living proof that rarely are superior technical means being espoused.
Superior sales are the more likely culprit,
It's certainly a mistake to say the goals of .NET, as if
they were a monolithic whole.
But the point is, some of the (technical) goals of .NET are
worthy, if not the slightest bit original; and so it should
not be a shame if some of Perl6's goals were collinear
with them. And I hope that ends
[EMAIL PROTECTED] writes:
: Hopefully the something similar, I hope in Perl 6 we will able to
: bury the 0 but true workaround to the backyard on a moonless night :-)
:
: Especially since you don't need it. 0E0 and 0., to name just two,
: work just as well. ;-)
:
:
On Wed, May 02, 2001 at 03:19:44PM -0700, Austin Hastings wrote:
Actually, Clippy is definitely worth stealing. In fact, the whole
notion of Generalized Robotic Open-source Animated Cartoon Images
(GROACI) is imperative to the future of perl.
See http://www.cepstral.com -- and there will be
40 matches
Mail list logo