lua-users home
lua-l archive

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


I noticed that the 5.2.0work3 refman chapter 2 has been split into two
chapters, where the first is more dedicated to runtime semantics,
while the latter is more about syntax.  On the surface this may seem
good since there are many Lua implementations [1], some without any
standard parser or concept of Lua syntax at all.  But, I'm not so sure
the two can be effectively separated--that is to describe semantics
without "a" syntax, at least a normative one.   The section on
metatables has a lot of relatively complex code provided before giving
even introductory lexical conventions.  Environments in 5.2 might be
argued to now be a purely lexical concept closely related to
Visibility Rules.  Metatables/garbage collection/coroutines are not
beginning concepts, but they are outlined even before variables.
True, the refman is not PiL for necessarily linear reading, but many
people use the refman for learning.

The separation is a good goal but maybe not to such an extent.  In the
5.1 manual, lexical conventions and variables/types are in
side-by-side but separate chapters (with lexical conventions often
being representations of values/types), and both are fundamental and
therefore presented early on.  You might, however, reverse the two and
place values/types before lexical conventions since the concept of
values/types is more fundamental than their representations.

Anyone else have opinions on the manual organization, in this aspect
or otherwise?

[1] http://lua-users.org/wiki/LuaImplementations