lua-users home
lua-l archive

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


I can't understand well environments and so the function getfenv.
For example we have :

    local aa="bb"
    local cc="dd"
    local f = function() end

will env2 :
- be the same as env1 since it inehrit from env1 ? (so won't contain
neither aa or cc)
- be a table with feilds from env1 plus aa (and cc ?) ?
- be a table with just aa (and cc ?) ?
- be a table with just aa (and cc ?) ? but with his
metatable(env2).__index = env1
sames questions for env3

I made that test and I found that env2 doesn't contains neither aa not
cc .... Why ? The same for env3

I know I ask many questions ... But I don't understand how it works ...
maybe a chance to improve lua's documentation.


<> ou <>
Le courrier E-mail est une correspondance privée. Merci de vous y conformer

Attachment: signature.asc
Description: OpenPGP digital signature