On Mon, Jan 12, 2009 at 9:07 AM, jesse <je...@fsck.com> 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 favor of using the proposed syntax, but I will agree with lwall that
it seems like overkill to have the specialized trims. .trim should be
non-destructive and .=trim should be destructive (these seems intuitive).

Some languages run in the direction of left-to-right, some in the direction
right-to-left (some even top-to-bottom). No matter what language you speak
or which direction your native language reads, left is the same for everyone
as well as right.

If we wanted to simplify matters, use :left, :right and :both. Those have
the same meaning everywhere.

If we wanted language dependent version, use :leading, :trailing, and :both.
That will require each implementation properly handle the language
variations.

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

-Jason "s1n" Switzer

Reply via email to