- Original Message
From: Patrick R. Michaud pmich...@pobox.com
I would expect this to be roughly equivalent to:
for @array { $_ .= trim; }
For an array of hashes, this would result in each hash element
of @array being replaced with a reference to an array of the
On Wed, Jan 14, 2009 at 03:37:57AM -0800, Ovid wrote:
- Original Message
From: Patrick R. Michaud pmich...@pobox.com
Oops -- I over-referenced here. The corrected form:
For C @array».=trim , each element of @array would be replaced
with its trimmed string representation.
* Ovid publiustemp-perl6langua...@yahoo.com [2009-01-13 00:35]:
* Larry Wall la...@wall.org [2009-01-13 00:25]:
It should probably say No such method. We have hyperops now
to apply scalar operators to composite values explicitly:
@array».=trim
Won't that fail with 'No such method' on
On Mon, Jan 12, 2009 at 03:30:05PM -0800, Ovid wrote:
From: Larry Wall la...@wall.org
: my @array = ' foo ', ' bar ';
: @array .= trim;
: say @array.perl;
:
: And what if I have an array of hashes of hashes of arrays?
:
: Currently you can call 'trim' on arrays, but
Ovid wrote:
What should this output?
my @array = ' foo ', ' bar ';
@array .= trim;
say @array.perl;
And what if I have an array of hashes of hashes of arrays?
Currently you can call 'trim' on arrays, but it's a no-op. Similar issues
with chomp and friends.
I think
On Tue, Jan 13, 2009 at 08:19:25AM -0600, Patrick R. Michaud wrote:
@array».=trim
Won't that fail with 'No such method' on an array of hashes?
Or are hyperops applied recursively?
I would expect this to be roughly equivalent to:
for @array { $_ .= trim; }
For an array
What should this output?
my @array = ' foo ', ' bar ';
@array .= trim;
say @array.perl;
And what if I have an array of hashes of hashes of arrays?
Currently you can call 'trim' on arrays, but it's a no-op. Similar issues with
chomp and friends.
Cheers,
Ovid
--
Buy the book
On Mon, Jan 12, 2009 at 03:05:21PM -0800, Ovid wrote:
: What should this output?
:
: my @array = ' foo ', ' bar ';
: @array .= trim;
:
: say @array.perl;
:
: And what if I have an array of hashes of hashes of arrays?
:
: Currently you can call 'trim' on arrays, but it's a no-op.
- Original Message
From: Larry Wall la...@wall.org
: my @array = ' foo ', ' bar ';
: @array .= trim;
:
: say @array.perl;
:
: And what if I have an array of hashes of hashes of arrays?
:
: Currently you can call 'trim' on arrays, but it's a no-op. Similar