At Fri, 26 Apr 2002 09:40:14 +0100,
Andy Wardley wrote:
This is an approach I've used to great effect in the Template Toolkit.
In this case, the iterator controlling a 'FOREACH' loop is aliased to
the 'loop' variable
[% FOREACH x = y %]
[% table\n IF loop.first %]
tr
On Thu, 2002-04-25 at 18:20, Damian Conway wrote:
Miko O'Sullivan wrote:
before { ... } # run before first iteration,
# only if there is at least one iteration
Larry is still considering allowing a CFIRST block that would do this.
[...]
This will be called a
On Fri, Apr 26, 2002 at 10:29:58AM -0400, Aaron Sherman wrote:
On Thu, 2002-04-25 at 18:20, Damian Conway wrote:
Miko O'Sullivan wrote:
before { ... } # run before first iteration,
# only if there is at least one iteration
Larry is still considering
At 2:26 PM +0100 4/26/02, Nicholas Clark wrote:
On Tue, Apr 23, 2002 at 01:25:15PM -0400, Dan Sugalski wrote:
At 12:36 PM -0400 4/23/02, Buddha Buck wrote:
OK, but that limits you to the, um, 24 standard levels of
precedence. What do you do if you don't think that that's enough
On Fri, Apr 26, 2002 at 11:33:06AM -0400, Dan Sugalski wrote:
At 2:26 PM +0100 4/26/02, Nicholas Clark wrote:
On Tue, Apr 23, 2002 at 01:25:15PM -0400, Dan Sugalski wrote:
At 12:36 PM -0400 4/23/02, Buddha Buck wrote:
OK, but that limits you to the, um, 24 standard levels of
On Fri, Apr 26, 2002 at 08:49:23AM +1000, Damian Conway wrote:
Trey Harris wrote:
So:
for $results.get_next() {
FIRST { print Results:BR; }
NEXT { print HR; }
} else {
print No results.;
}
Do I have that right?
Yes. Presuming Larry decides in favour of CFIRST and
This is now extensible to any number of precedence levels, and you can
now use simple string comparison to compare any two precedences. It even
short circuits the comparison as soon as it finds a character that
differs.
Gee, maybe I should patent this.
Too late. Amazon has already
At 5:05 PM +0100 4/26/02, Tim Bunce wrote:
On Fri, Apr 26, 2002 at 11:33:06AM -0400, Dan Sugalski wrote:
At 2:26 PM +0100 4/26/02, Nicholas Clark wrote:
On Tue, Apr 23, 2002 at 01:25:15PM -0400, Dan Sugalski wrote:
At 12:36 PM -0400 4/23/02, Buddha Buck wrote:
OK, but that limits you
Tim Bunce writes:
: For perl at least I thought Larry has said that you'll be able to
: create new ops but only give them the same precedence as any one
: of the existing ops.
Close, but not quite. What I think I said was that you can't specify
a raw precedence--you can only specify a
At 09:45 AM 04-26-2002 -0700, Larry Wall wrote:
Tim Bunce writes:
: For perl at least I thought Larry has said that you'll be able to
: create new ops but only give them the same precedence as any one
: of the existing ops.
Close, but not quite. What I think I said was that you can't specify
a
Buddha Buck writes:
: So you'd have something like:
:
: sub operator:mult($a, $b) is looser('*') is inline {...}
: sub operator:add($a, $b) is tighter(+) is inline {...}
: sub operator:div($a,$b) is looser(/) is inline {...}
:
: assuming default Perl5 precedences for *, *, and / you would have
Larry Wall [EMAIL PROTECTED] writes:
: Why not use a 16 bit int and specify that languages should use
: default precedence levels spread through the range but keeping the
: bottom 8 bits all zero. That gives 255 levels between '3' and '4'.
: Seems like enough to me!
:
: Floating point
On Fri, 2002-04-26 at 14:11, Allison Randal wrote:
On Fri, Apr 26, 2002 at 08:49:23AM +1000, Damian Conway wrote:
Hmmm... how about:
for $results.get_next() {
print $_;
LAST { print Done.; }
ELSE { print No results.; }
}
The else of a loop construct isn't really the same as the
On Fri, Apr 26, 2002 at 05:24:13PM -0400, Aaron Sherman wrote:
On Fri, 2002-04-26 at 14:11, Allison Randal wrote:
The else of a loop construct isn't really the same as the else of an
Cif. You can't use an Celsif for one thing.
Why not? What would be wrong with:
for x {
Of course it brings other less wholesome things to mind like elsfor
and elsloop and if ... elsfor and for ... elsif ... elsloop ...
else, but why not?
Well, I agree with the concept, but boyoboy those names ain't gonna
fly. We'll have to head down the road of
unlessfor
On Fri, 26 Apr 2002, Allison Randal wrote:
Besides, I would expect an Celsfor to actually be a loop of it's own,
on the principle of elsif = else + if so elsfor = else + for.
So, you're suggesting we add Celsunless then? Just because it's
possible doesn't mean it's necessary.
Luke
On Fri, Apr 26, 2002 at 11:14:36PM -0600, Luke Palmer wrote:
On Fri, 26 Apr 2002, Allison Randal wrote:
Besides, I would expect an Celsfor to actually be a loop of it's own,
on the principle of elsif = else + if so elsfor = else + for.
So, you're suggesting we add Celsunless then? Just
17 matches
Mail list logo