[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: metamethods for assignment and type conversion
- From: Miles Bader <miles.bader@...>
- Date: Mon, 13 Aug 2007 15:05:09 +0900
Adrien de Croy <adrien@qbik.com> writes:
> It could be considered radical maybe for tables.
>
> for userdata and lightuserdata, it makes perfect sense to use the same
> syntax to copy one userdata to another one the same as you would a
> string value, rather than a function to do it.
It seems a fairly fundamental part of Lua that it's a "reference"
language (like lisp/scheme, clu, etc): variables store references to
their value, not the values (this is slightly relaxed for numbers, but
that doesn't change the general properties of this behavior).
The result is that users can rely on assignment being very cheap, and
having no side effect other than the obvious one.
I think any change to this could be considered "huge", as could be any
change that makes "assignment" (with "=") different than e.g. parameter
passing.
-Miles
--
The car has become... an article of dress without which we feel uncertain,
unclad, and incomplete. [Marshall McLuhan, Understanding Media, 1964]