lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, 8 Mar 2010 21:20:18 -0300
Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

> > This is a strange point of view, for me. I mean it's fully correct,
> > sure, but when do we need to express an empty (sub)string (or any kind
> > of sequence) using literal indexes?
> 
> They do not need to be literals. (1,0) is the result of string.find
> when it finds an empty string in the beginning of a string:
> 
>   print(string.find("a", "%d*"))   -->  1   0
> 
> string.find must be able to express that result, and so string.sub should
> accept that too.

Oh, yes. Thank you for this precision.

> -- Roberto

Denis
-- 
________________________________

la vita e estrany

spir.wikidot.com