|galera não estou conseguindo remover o meu nome do grupo, o meu inglês ainda não esta no nivel de voces, alguem pode me ajudar.?|
Gerson R. Borges
"A repetição com correção até a exaustão, leva a perfeição"
(61) - 9132-6628
(61) - 3314-7579
--- Em qua, 6/8/08, Petite Abeille <firstname.lastname@example.org> escreveu:
De: Petite Abeille <email@example.com>
Assunto: Re: debug.getinfo( aLevel, 'S' ).source?
Para: "Lua list" <firstname.lastname@example.org>
Data: Quarta-feira, 6 de Agosto de 2008, 19:47
On Aug 7, 2008, at 12:14 AM, Luiz Henrique de Figueiredo wrote:
> When combining several programs into one file, luac creates a hidden
> program that simply runs the given program. That hidden program in
> "=(luac)" as its source, in the absence of anything else that
> be useful.
> Like the other programs, the main program is precompiled and so
> keeps its
> own notion of the source name. Changing the name of the file that
> precompiled code does not affect the names stored in the files.
I see... so... compiling 'module.lua' into 'module.luac' will
statically record '@module' as the source for that code in the luac
file itself, right? From then on, debug.getinfo will always return
'@module' as the source for that bytecode, irrespectively of the
effective code provenance, correct?
In other words, if code is loaded from a lua file, one gets its
location, if loaded from a luac file ones get the static information
recorded at the time of compilation, irrespectively of where the luac
bytecode was loaded from.
On the other hand... code coming from source or bytecode should be
equivalent for all practical purpose, no? But, in the case of
debug.getinfo at least, they seem to behave rather differently...
> Are you proposing otherwise?
At this conjuncture, yes... I would argue that debug.getinfo( 'S' )
should consistently return the effective source location of a piece of
code, no matter if it's plain source or bytecode.
Just my 2¢ though.