lua-users home
lua-l archive

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


But what is really a bit not so nice in lua, if you are used to C at
least, is that you can not easily check the first character of a
string... e. g. if you use a string for setting some function options,
it would be quite nice if you could check the start character beeing
'a' or other char without invoking a string lib function ... but using
single quotes as alternative for string delimiters is of course that
much useful and smart, that no delimiters for char bytes is left, I
fully recognize this ... .

(I am working on an IoT project, and most of my Lua demo code examples
would alreadly work in basic Lua (thus without using "openlibs" - this
would save about 50kB of my valuable 130kB ROM Code...), just
additinoally the string lib functions usually are needed for some very
restricted things ... so mainy only this string.sub, and a somehow
very "stripped down" function string.find (similar to strchr) also
would be sufficient for my needs... would be somehow nice to have some
sort of "string-mini-lib" version for this - but it would somehow be
necessary to be documented by Lua, otherwise I think it would not make
much sense...).

But of course completely off-topic here, please excuse :) ... just
also somehow further "useless remark" :)  ... (but your remark much
more sophisticated and fascinating - clearly cheers to you...;)).


On Tue, Sep 14, 2021 at 8:05 PM Hugo Musso Gualandi
<hgualandi@inf.puc-rio.br> wrote:
>
>
>
> > This is only consequential as the name of the Lua programming shares
> > the same property, which can not be said for e.g. C, which starts and
> > ends with the same letter 'C'.
>
> I did warn that it was an useless fact :)
>
> However, this is not quite what I meant. For example, "else" both
> starts and ends with "e".
>