[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.2.0 (beta-rc1) now available
- From: Mike Pall <mikelu-1106@...>
- Date: Wed, 15 Jun 2011 20:27:26 +0200
Roberto Ierusalimschy wrote:
> This time, however, we would like feedback about the syntax for labels,
> because of the small incompatibility of the '@' with filenames.
Simply prepend a space in case the chunkname derived from a string
starts with a '@'. You only need to change luaL_loadstring and
luaB_load. Problem solved.
If a user explicitly supplies a chunkname that starts with a '@',
they ought to know what they are doing (e.g. if the source code
originates from a file).
Actually a related usability problem is that few users provide an
explicit chunkname to loadstring() (in 5.1) or load() (in 5.2). So
the chunkname is set equal to the original string and is attached
to each function prototype. This keeps the string alive and may
occupy a lot of memory. And the complete original source code will
end up in a bytecode dump, too!
OTOH for tracebacks etc. only a shortened version is shown. Few
users realize where the memory hog comes from or why their
bytecode dumps take up so much space.