lua-users home
lua-l archive

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

Browsing through the python documentation, I found that they have
implemented pretty much exactly what I am talking about:

What's really nice is the "packing" and "unpacking", ie.
frog = 10, 20, 30    -- packs frog with 3 numbers
x, y, z = frog  -- unpacks frog into its 3 separate elements

These tuples are *immutable* sequences, ie. they are constants.

Lua would benefit greatly from this kind of feature.

Q-Games, Dylan Cuthbert.

"Enno Rehling" <> wrote in message
> Dylan Cuthbert wrote:
> > The problem isn't really to do with 3d, its a conceptual problem.  What
I am
> > aiming for is a kind of "tuple" implementation, where an atomic type is
> > of parts and those parts aren't independent of one another, they work as
> > "whole".
> IIRC, then C99 has a built-in 'complex' datatype. Is that something like
> what you're looking for, only for something with bigger tuples? I can't
> I've used it or even seen how it looks (how do you access the components
> the complex number?), is anyone knowledgeable about this? And how it's
> implemented?
> Enno
> -- 
> <xterm> The problem with America is stupidity. I'm not saying there should
>       be a capital punishment for stupidity, but why don't we just take
>       the safety labels off of everything and let the problem solve