[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
**Subject**: **Re: Arithmetic on strings**
**From**: Roberto Ierusalimschy <roberto@...>
**Date**: Wed, 13 Jun 2012 14:38:10 -0300

> What precisely are we talking about?
>
> (1) 1 + "2" (- * / etc)
>
> (2) 1 .. "2"
>
> (3) concat({1,"2"})
>
> (4) format("%s",1)
>
> I suppose only in the first case automatic conversion is unwanted?
> Actually I can imagine that a future concat does a tostring if
> needed so that { 1, "2", true } also works.
I am talking mostly about (1). (2) could be kept, but probably
implemented through some metamethod by the standard library.
(3), (4), and others could be handled on an individual basis. (For
instance, does anyone need string.gsub(10000, 0, 1)?)
-- Roberto

**References**:
**Arithmetic on strings, ***Dirk Laurie*
**Re: Arithmetic on strings, ***Roberto Ierusalimschy*
**Re: Arithmetic on strings, ***Andrew Starks*
**Re: Arithmetic on strings, ***steve donovan*
**Re: Arithmetic on strings, ***liam mail*
**Re: Arithmetic on strings, ***Andrew Starks*
**Re: Arithmetic on strings, ***Javier Guerra Giraldez*
**Re: Arithmetic on strings, ***Roberto Ierusalimschy*
**Re: Arithmetic on strings, ***liam mail*
**Re: Arithmetic on strings, ***Hans Hagen*