On Mon, Jan 12, 2009 at 6:26 PM, Ovid
wrote:
> - Original Message
>
> > From: jason switzer
>
> > 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 :
- Original Message
> From: jason switzer
> 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
c
On Mon, Jan 12, 2009 at 9:07 AM, jesse wrote:
>
> 'left' and 'right' are probably not the right names for functions which
> trim leading and/or trailing space, since their meanings get somewhat
> ambiguous if a language renders right-to-left instead of left-to-right
> or vice-versa
>
I'm in favo
- 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
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
- 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
- Original Message
> 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 examples to run. Bummer :(
C
21 matches
Mail list logo