lua-users home
lua-l archive

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


On Apr 21, 2014, at 12:53 AM, Coda Highland <chighland@gmail.com> wrote:

> On Sun, Apr 20, 2014 at 9:54 PM, Paige DePol <lual@serfnet.org> wrote:
>> `fvalue` and `setfvalue` are already in use for light c functions, which is why I suggested `r` for "real".
>> 
>> What confusing connotation are you referring to, by the way?
> 
> When designing a language, the concepts of "lvalue" and "rvalue" come
> into play. An "lvalue" is an expression that can be assigned to (that
> can appear on the "L"eft hand side of an = sign), and an "rvalue" is
> anything that isn't an lvalue (that is, something that can only appear
> on the "R"ight hand side of an = sign).
> 
> Overloading "rvalue" to mean "real value" might cause some semantic
> dissonance in those reading the code.
> 
> /s/ Adam

Oh, yea, LoL, I didn't even think of lvalue and rvalue in the context of expressions, just in the context of the other getter/setter macros.

Though, to be honest, once you know the various macros when hacking the Lua source the context of `setrvalue` and `rvalue` would probably not cause confusion with the expression context of `rvalue`. Though, to be clear it is probably best to avoid `setrvalue` and `rvalue` for these macros.

That said, I would imagine the intent of the developers was to change both macros to use `flt` instead of `n`, which was my main reason for bringing this up. :)

~pmd~