lua-users home
lua-l archive

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

steve donovan <> writes:
>> Any language with native support for tuples (or equivalent constructs) can
>> do multiple returns trivially, so this dates back to Lisp at least, which
>> puts it as about 1959.
> Ah, but there is an important difference: this code has the same
> effect in Lua and Python:
>     x,y = something()
> but in Python there is an explicit tuple type and this multiple
> assignment causes that tuple to be unpacked, which is a rather less
> efficient process.

Yeah, and "tuple based" MRV tend to have a very different ("more rigid")
feel than the looser MRV in languages like Lua and CL, and I think the
two styles often result in significantly different usage.


Cat, n. A soft, indestructible automaton provided by nature to be kicked when
things go wrong in the domestic circle.