- Original Message
> From: Geoffrey Broadwell
> When I saw your proposed syntax above, instead of reading "don't trim
> leading/trailing whitespace", I read "change the definition of
> 'whitespace' to 'codepoint 0' for leading/trailing".
>
> That of course raises the question of how on
On Jan 12, 2009, at 11:27 AM, Carl Mäsak wrote:
How about .trim(:start) and .trim(:end)?
And .trim(:both) for orthogonality.
--
Andy Lester => a...@petdance.com => www.petdance.com => AIM:petdance
Ovid (>):
> =item trim
>
> our Str multi Str::trim ( Str $string )
>
> Removes leading and trailing whitespace from a string.
>
> =cut
>
> I could optionally make the following work:
>
> $string.trim(:leading<0>);
> $string.trim(:trailing<0>);
>
> Setting leading or trailing to false (the
- Original Message
> >> Agreed, but ltrim and rtrim will disappoint Israelis and dyslexics alike.
> >> Suggestions welcome as I can't think of anything better.
> >
> > The .Net framework calls 'em TrimStart and TrimEnd (and has a Trim that does
> > both). So maybe trim_start and trim_en
Jonathan (>), Ovid (>>), Larry (>>>):
>>> Can't say I really like the negated options though. They smell funny.
>>
>> Agreed, but ltrim and rtrim will disappoint Israelis and dyslexics alike.
>> Suggestions welcome as I can't think of anything better.
>
> The .Net framework calls 'em TrimStart an
Seems Larry's agreed to the .trim method. There are bits that are not agreed
upon, so this patch only implements what we've agreed upon. It relies on the
new S29-str/trim.t test in pugs. I committed that earlier and updated
t/spectest.data.
In other words, the patch is a tad clearer and no
On Mon, Jan 12, 2009 at 9:01 AM, Ovid
wrote:
> - Original Message
>
>
> > > > I could optionally make the following work:
> > > >
> > > > $string.trim(:leading<0>);
> > > > $string.trim(:trailing<0>);
>
> Alternatively, those could be ltrim() and rtrim(). If you need to
> dynamically d
- Original Message
> > > I could optionally make the following work:
> > >
> > > $string.trim(:leading<0>);
> > > $string.trim(:trailing<0>);
Alternatively, those could be ltrim() and rtrim(). If you need to dynamically
determine what you're going to trim, you'd couldn't just set va
- Original Message
> > =item trim
> >
> > our Str multi Str::trim ( Str $string )
> >
> > Removes leading and trailing whitespace from a string.
> >
> > =cut
> >
> > I could optionally make the following work:
> >
> > $string.trim(:leading<0>);
> > $string.trim(:trailing<0>);
>
On Mon, Jan 12, 2009 at 09:33:32AM -0800, Geoffrey Broadwell wrote:
: That of course raises the question of how one *would* properly override
: trim's concept of whitespace
Well, given that .trim is essentially just .comb(/\S.*\S/), which in
turn is really just m:g/(\S.*\S)/, I don't see much
On Mon, 2009-01-12 at 07:01 -0800, Ovid wrote:
> - Original Message
>
>
> > > > I could optionally make the following work:
> > > >
> > > > $string.trim(:leading<0>);
> > > > $string.trim(:trailing<0>);
>
> Alternatively, those could be ltrim() and rtrim(). If you need to
> dynamica
Ovid wrote:
- Original Message
In the pir, doesn't the "s = self" line copy self, thus ensuring that I'm changing "s" and not "self"?
No, it's binding.
Or do I need "s = clone self" (or however it's written).
Yeah, but also note that substr would return a copy...
Can't sa
- Original Message
> From: Larry Wall
> On Mon, Jan 12, 2009 at 05:04:50AM -0800, Ovid wrote:
> : ...the trivial $string.trim and trim($string) case.
>
> Hmm, I'd think .trim should work like .chomp, and return the trimmed
> string without changing the original. You'd use $str.=trim t
On Mon, Jan 12, 2009 at 05:04:50AM -0800, Ovid wrote:
: ...the trivial $string.trim and trim($string) case.
Hmm, I'd think .trim should work like .chomp, and return the trimmed
string without changing the original. You'd use $str.=trim to do it
in place.
Can't say I really like the negated optio
On 2009-01-12 Ovid wrote:
> Um, er. Damn. Now I'm wondering how my "leading" and "trailing"
> trimming works with Hebrew. How are the strings implemented
> internally?
RTL (and bidi) languages are written in strings so that the character
order is the logical, reading, order. That is, the chara
- Original Message
> From: jesse
>
> On Mon, Jan 12, 2009 at 07:01:25AM -0800, Ovid wrote:
> > > > > I could optionally make the following work:
> > > > >
> > > > > $string.trim(:leading<0>);
> > > > > $string.trim(:trailing<0>);
> >
> > Alternatively, those could be ltrim() and rtri
On Mon, Jan 12, 2009 at 07:01:25AM -0800, Ovid wrote:
> > > > I could optionally make the following work:
> > > >
> > > > $string.trim(:leading<0>);
> > > > $string.trim(:trailing<0>);
>
> Alternatively, those could be ltrim() and rtrim().
'left' and 'right' are probably not the right name
Parrot Bug Summary
http://rt.perl.org/rt3/NoAuth/parrot/Overview.html
Generated at Mon Jan 12 14:00:01 2009 GMT
---
* Numbers
* New Issues
* Overview of Open Issues
* Ticket Status By Version
* Requestors with m
- Original Message
> From: Ovid
> > This patch implements the .trim() method for strings.
>
> Now that I'm reading S29, I see there is no .trim() method there. I got that
> because it was referenced in pugs in the cookbook (not in tests, though) and
> I
> was trying to get the exam
19 matches
Mail list logo