lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: Local variables in the main block are global
From
: steve donovan <steve.j.donovan@
...
>
Date
: Wed, 24 Apr 2013 10:42:22 +0200
On Mon, Apr 22, 2013 at 9:25 PM, joao lobato
<
btnfdp.lobato@gmail.com
>
wrote:
So, you want functions...
Heh, well put! It would be nice if dofile() was allowed to pass arguments to the main chunk. E.g. we have 'dofile.lua' which is just:
print (...)
dofile() won't pass any arguments - but it's easy to write a dofile which does take arguments:
> c = loadfile 'dofile.lua'
> c('one',1,20)
one 1 20
BTW, there is a little diffference between require() on 5.1 and 5.2:
> require 'dofile'
dofile .\dofile.lua
That is, also passes the filename as well as the module name.
steve d.
Follow-Ups
:
Re: Local variables in the main block are global
,
Owen Shepherd
References
:
Local variables in the main block are global
,
Dirk Laurie
Re: Local variables in the main block are global
,
Dirk Laurie
Re: Local variables in the main block are global
,
Dirk Laurie
Re: Local variables in the main block are global
,
Dirk Laurie
Re: Local variables in the main block are global
,
Dirk Laurie
Re: Local variables in the main block are global
,
Owen Shepherd
Re: Local variables in the main block are global
,
joao lobato
Prev by Date:
Re: The state of Luasocket
Next by Date:
Re: Syntax sugar for default arguments
Previous by thread:
Re: Local variables in the main block are global
Next by thread:
Re: Local variables in the main block are global
Index(es):
Date
Thread