[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Local variables in the main block are global
- From: Owen Shepherd <owen.shepherd@...>
- Date: Thu, 25 Apr 2013 04:04:03 +0100
steve donovan wrote:
On Mon, Apr 22, 2013 at 9:25 PM, joao lobato <email@example.com
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:
dofile() won't pass any arguments - but it's easy to write a dofile
which does take arguments:
> c = loadfile 'dofile.lua'
one 1 20
BTW, there is a little diffference between require() on 5.1 and 5.2:
> require 'dofile'
That is, also passes the filename as well as the module name.
Right, but what I was wishing for was the ability to name the parameters passed to the function returned by load()
<button _onclick_="table.insert(eventLog, ev)">Name</button>