lua-users home
lua-l archive

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


Peter Hill:
> I disagree. In C "lvalues" (ie, variables) have a type but *so do*
> "rvalues" (ie, objects). Though rvalues do have a short lifetime (such
> that they may only exist on the stack) they are objects independent from
> variables, carrying their own type.

RLake@oxfam.org.uk:
> And exactly where do they carry it? How do you figure out what the type of
> an arbitrary C value is? They "carry" a type during compilation. But that
> is not the same thing.

At runtime the type (for variables _and_ objects) is stored in the code that
accesses the data rather than in the object/variable itself.

And stack objects carry exactly the _same_ amount of type information that
variables do, so if you say that variables (lvalues) are typed then you must
also say that objects (rvalues) are typed as well.

*cheers*
Peter Hill.