[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Syntax/implementation question
- From: Paul K <paul@...>
- Date: Wed, 27 Jul 2016 17:54:35 -0700
Hi Peter,
> 3. print(1), print(2), print(3) is an expression list.
> If all that is right, my remaining question: why isn’t the last call in
> an expression list also taken “as is”. I.e., once again, why not `nil, nil,
> nil`?
According to the docs [1] "return f1(), f2(), f3()" has f1 adjusted to
1 result (which returns `nil` instead of nothing), f2 also adjusted to
1 result, and f3 is adjusted to return all results (and there are
none), which produces `nil, nil` result you get.
Paul.
[1] https://www.lua.org/manual/5.3/manual.html#3.4