As a third possibility, could we huffman-code do nothing clauses by
leaving out the appropriate argument? That is:
while $x-- some_condition($x);
That's a bit too short for my liking: it is likely to lead to the
traditional C undetectable bug when you write
while $x--
Jonathan Lang:
could we huffman-code do nothing clauses by
leaving out the appropriate argument?
while $x-- some_condition($x);
Heheh, I often code like that, and then silence the complaint by adding
the {}.
--
Grtz, Ruud
HaloO,
Nicholas Clark wrote:
Well, I assume that the do-nothing sub is assigned into the variable, and
gets re-evaluated each time the variable is use. Which would mean that you'd
get a new (different) empty hash each time. Whereas an empty hash constructor
gives you a hash reference to keep.
On Fri, Dec 23, 2005 at 10:43:23AM +0100, TSa wrote:
HaloO,
Nicholas Clark wrote:
Well, I assume that the do-nothing sub is assigned into the variable, and
gets re-evaluated each time the variable is use. Which would mean that
you'd
get a new (different) empty hash each time. Whereas an
On Thu, Dec 22, 2005 at 03:19:03PM -0800, Jonathan Lang wrote:
: As a third possibility, could we huffman-code do nothing clauses by
: leaving out the appropriate argument? That is:
:
: while $x-- some_condition($x);
:
: or
:
: loop ( ; some_condition($x) ; $x--);
We could, except that
At 7:42 AM + 12/22/05, Luke Palmer wrote:
Recently, I believe we decided that {} should, as a special case, be
an empty hash rather than a do-nothing code, because that's more
common.
However, what do we do about:
while $x-- some_condition($x) {}
Here, while is being passed a hash,
HaloO,
Luke Palmer wrote:
Recently, I believe we decided that {} should, as a special case, be
an empty hash rather than a do-nothing code, because that's more
common.
Ups, is that distinction needed eagerly? Wouldn't the return value
of a do-nothing code return a value that when coerced into
Luke Palmer skribis 2005-12-22 7:42 (+):
Recently, I believe we decided that {} should, as a special case, be
an empty hash rather than a do-nothing code, because that's more
common.
I think it should be both.
my $foo = {};
$foo(); # It was a sub
my $foo = {};
$foobar =
On Thu, 22 Dec 2005, TSa wrote:
Luke Palmer wrote:
Recently, I believe we decided that {} should, as a special case, be
an empty hash rather than a do-nothing code, because that's more
common.
Hmmm, OTOH a hash is a special kind of function, so it may also be
convenient to think of {
On Thu, 22 Dec 2005, Juerd wrote:
while $x-- some_condition($x) {}
Here, while is being passed a hash
Why? Doesn't while's signature specifically prescribe a sub there, and
if it does, then wouldn't it be just a bit too silly to stick to {}
being a hash?
Well, as hinted in my other
On Thu, 22 Dec 2005, Darren Duncan wrote:
On a separate but related matter, I'm in the position of wanting to do
something unusual, which is create a data file format whose content is
executable perl code that defines a data structure, a hash of whatever.
Kind of like how XML works except
Luke Palmer wrote:
However, what do we do about:
while $x-- some_condition($x) {}
Here, while is being passed a hash, not a do-nothing code. Should we
force people to write:
while $x-- some_condition($x) {;}
Do we still have a yada yada yada? Could it be used to
HaloO,
Juerd wrote:
I think it should be both.
So do I.
my $foo = {};
$foo(); # It was a sub
The postfix () is valid syntax irrespective of the former
assignment, right?
my $foo = {};
$foobar = 1; # It was a hash
Would you expect the second line to work witout the
At 3:40 PM +0100 12/22/05, Michele Dondi wrote:
On Thu, 22 Dec 2005, Darren Duncan wrote:
On a separate but related matter, I'm in the position of wanting to
do something unusual, which is create a data file format whose
content is executable perl code that defines a data structure, a
hash
-Original Message-
From: Austin Frank [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 22, 2005 10:58 AM
To: Luke Palmer
Cc: perl6language,
Subject: Re: Problem with dwimmery
Do we still have a yada yada yada? Could it be used to differentiate
between the two cases
On Thu, Dec 22, 2005 at 02:53:39PM +0100, TSa wrote:
HaloO,
Luke Palmer wrote:
Recently, I believe we decided that {} should, as a special case, be
an empty hash rather than a do-nothing code, because that's more
common.
Ups, is that distinction needed eagerly? Wouldn't the return value
16 matches
Mail list logo