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:

http://www.python.org/doc/current/tut/node7.html#SECTION007300000000000000000

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.
http://www.q-games.com

"Enno Rehling" <enno@despammed.com> wrote in message
news:bdopj9$eu4$1@main.gmane.org...
> 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
made
> > of parts and those parts aren't independent of one another, they work as
a
> > "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
say
> I've used it or even seen how it looks (how do you access the components
in
> 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
itself?
>
>
>