Re: [PATCH] Add .trim method

[email protected] (Ovid) Mon, 12 Jan 2009 16:26:09 -0800 (PST)
Newsgroups perl.perl6.language,perl.perl6.internals
Message-ID <[email protected]>
----- Original Message ----

> From: jason switzer <[email protected]>

> If we wanted language dependent version, use :leading, :trailing, and :both.
> That will require each implementation properly handle the language
> variations.
 
I think :start and :end are my favorites.  Huffman++ (maybe :begin and :end for consistency?).

Still raises the question of what to do with arrays of hashes of arrays with @array >> .= trim;

I can't trim keys of pairs because they're used as unique identifiers in hashes and conflicts will occur.  So recursive trimming needs have a special case for keys or it needs to not be allowed (and thus fail with AoHoA and similar complex data structures).

> By the way, good work on this. Everyone loves useful string functions.

Thanks.  It's been lots of fun :)

 
Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6