On Mon, Dec 15, 2008 at 04:43:51PM -0700, David Green wrote:
I can't really think of a great example where you'd want to numify a
pair, but I would expect printing one to produce something like a =
23 (especially since that's what a one-element hash would print,
right?).
Nope, would
On Mon, Dec 15, 2008 at 10:26 PM, Larry Wall la...@wall.org wrote:
On Mon, Dec 15, 2008 at 04:43:51PM -0700, David Green wrote:
I can't really think of a great example where you'd want to numify a
pair, but I would expect printing one to produce something like a =
23 (especially since that's
HaloO,
Moritz Lenz wrote:
The counter example is if you want to print a pair:
.say for %hash.pairs.sort: { .value };
In that case it would be nice to have the key appear in the stringification.
I see no problem as long as say gets a pair as argument. Then it can
print the key and value
TSa wrote:
I see no problem as long as say gets a pair as argument. Then it can
print the key and value separated with a tab. More problematic are
string concatenations of the form
say the pair is: ~ (foo = $bar);
which need to be written so that say sees the pair
say the pair is: ,
Moritz Lenz wrote:
Off the top of my head, see S06 for the gory details:
my $pair = a = 'b';
named(a = 'b');
named(:ab);
named(|$pair);
positional((a = 'b'));
positional((:ab));
positional($pair);
As you say: the gory details, emphasis on gory. But if that's the way
of things, so be
Jon Lang wrote:
That's a good point. Is there an easy way to distinguish between
passing a pair into a positional parameter vs. passing a value into a
named parameter?
Off the top of my head, see S06 for the gory details:
my $pair = a = 'b';
named(a = 'b');
named(:ab);
named(|$pair);
On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
HaloO,
Carl Mäsak wrote:
Pugs and Elf currently numify a Pair object to 2, and Rakudo currently
dies of despair.
My guess is that the semantics of Pugs and Elf falls out naturally
form a pair being treated as a list of two elements, or
-- Original message --
From: Larry Wall la...@wall.org
On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
My idea is to let a pair numify to whatever the value numifies to.
Same thing with stringification. In general I think that a pair should
hide its key
mab == mark a biggar mark.a.big...@comcast.net writes:
mab -- Original message --
mab From: Larry Wall la...@wall.org
On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
My idea is to let a pair numify to whatever the value numifies to.
Same thing
Mark Biggar wrote:
The only use case I can think of is sorting a list of pairs;
should it default to sort by key or value?
But this isn't a case of numifying a Pair, or of stringifying it - or
of coercing it at all. If you've got a list of Pairs, you use a
sorting algorithm that's designed
On 2008-Dec-15, at 4:18 pm, Jon Lang wrote:
If you've got a list of Pairs, you use a sorting algorithm that's
designed for sorting Pairs (which probably sorts by key first, then
uses the values to break ties).
Agreed.
If you've got a list that has a mixture of Pairs and non-Pairs, I
Larry Wall wrote:
On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
HaloO,
Carl Mäsak wrote:
Pugs and Elf currently numify a Pair object to 2, and Rakudo currently
dies of despair.
My guess is that the semantics of Pugs and Elf falls out naturally
form a pair being treated as a list of
mark.a.big...@comcast.net wrote:
-- Original message --
From: Larry Wall la...@wall.org
On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
My idea is to let a pair numify to whatever the value numifies to.
Same thing with stringification. In general I think
Pugs and Elf currently numify a Pair object to 2, and Rakudo currently
dies of despair.
My guess is that the semantics of Pugs and Elf falls out naturally
form a pair being treated as a list of two elements, or something. The
question still deserves to be raised whether always-2 is a good
HaloO,
Carl Mäsak wrote:
Pugs and Elf currently numify a Pair object to 2, and Rakudo currently
dies of despair.
My guess is that the semantics of Pugs and Elf falls out naturally
form a pair being treated as a list of two elements, or something. The
question still deserves to be raised
15 matches
Mail list logo