lua-users home
lua-l archive

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


Well the link is wrong - but I must add that all the information supplied on
the www.ucore.com website is still beta and will change greatly upon
release. Our main concern is the 'quick access' to information. The main Lua
documentation is correct (This is not the issue), but the structure is not
well designed for quick access to the syntax for a specific command, nor is
the description of each command very readable

Example:
strfind (s, pattern [, init [, plain]])
Looks for the first match of pattern in s. If it finds one, then strfind
returns the indices of s where this occurrence starts and ends; otherwise,
it returns nil. If the pattern specifies captures (see gsub below), the
captured strings are returned as extra results. A third, optional numerical
argument init specifies where to start the search; its default value is 1,
and may be negative. A value of 1 as a fourth, optional argument plain turns
off the pattern matching facilities, so the function does a plain ``find
substring'' operation, with no characters in pattern being considered
``magic''. Note that if plain is given, then init must be given too.

Maybe it is because I'm from Denmark, but I have to read this a couble of
times before I get it :-) A simple example would make a big difference,
something like:
----------------------------------------------------------------------------
---
start,endstr = strfind("Hello Wonderfull World","full",1,1)
will return 13,16
----------------------------------------------------------------------------
---

A manual should use a simple sentence construction and supply examples on
the use of the language. After reading Robertos book (The draft) I was very
pleased and think this will fill a void for Lua.. There is no indication on
the Lua book regarding copyright/price/copyleft etc. yet but this will
surely come :-/

/Erik

----- Original Message -----
> For real life examples (which do not follow this practice :-), see
> uCore - http://thallium.nexen.net/thlua/thlua.html