[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Multiple return values from require()
- From: Matthias Kluwe <mkluwe@...>
- Date: Sun, 18 Oct 2009 19:29:05 +0200
2009/10/17 Peter Cawley <email@example.com>:
> On Sat, Oct 17, 2009 at 7:01 PM, Matthias Kluwe <firstname.lastname@example.org> wrote:
>> 2009/10/17 Linker <email@example.com>:
>>> You can return a table instead of a list .
>> Well, I know ... I can return _one_ table, but matrix.lua does return
>> two of them, and there has to be a trick (well, not a trick obviously,
>> but I can't find it in the reference manual).
> Look at http://www.lua.org/source/5.1/loadlib.c.html#ll_require - you
> will notice that all execution paths terminate with an error or
> "return 1;", hence require() can only return a single value.
Right. I was mislead by the above mentioned script which I assumed to
work. I checked now -- it does not.
Thank you for the clarification.