[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Backslash-newline escape as a line continuation rather than a newline?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 9 Apr 2010 10:59:46 -0300
> > Message d'origine De la part de Roberto Ierusalimschy
> >
> > The expression "1".."2"^3 would get a different meaning (1728, instead
> > of "18"). The same for -"1".."2" (subtle difference) or #"3".."5".
> >
>
> Pardon my ignorance, but what is the usefulness of being able to treat
> strings containing numbers as if they were numbers to begin with? [...]
Even if Lua did not coerce strings to numbers the problem would exist.
For instance, without coercion, it could be useful to allow metamethods
for arithmetic operations over strings (e.g., "a"^3 could result in "aaa").
It is always a bad idea to cripple some syntactical construction only
because it happens to not have a useful semantics.
-- Roberto
- References:
- Backslash-newline escape as a line continuation rather than a newline?, M Joonas Pihlaja
- Re: Backslash-newline escape as a line continuation rather than a newline?, Juris Kalnins
- Re: Backslash-newline escape as a line continuation rather than a newline?, Luiz Henrique de Figueiredo
- Re: Backslash-newline escape as a line continuation rather than a newline?, Quae Quack
- Re: Backslash-newline escape as a line continuation rather than a newline?, Roberto Ierusalimschy
- Re: Backslash-newline escape as a line continuation rather than a newline?, Stuart P. Bentley
- Re: Backslash-newline escape as a line continuation rather than a newline?, Luiz Henrique de Figueiredo
- Re: Backslash-newline escape as a line continuation rather than a newline?, Miles Bader
- Re: Backslash-newline escape as a line continuation rather than a newline?, Roberto Ierusalimschy
- RE: Backslash-newline escape as a line continuation rather than a newline?, Benoit Germain