‘Tuples’

06/05/2009

Tuples allows to store things togheter, they must be declared using {} separating items with a ,
A simple example of tuple is {5, 10}.
Is a good habit to insert (as first item of the tuple) an Atom that represents what the tuple is, for example:

Person = {person,
{name, simone},
{age, 26}}.

Tuples are defined when you declare them and are destroyed when you don’t use them anymore (thanks garbage collector) so we haven’t to worry about memory allocation/deallocation.

You can use variables to create a tuple, for example:

Name = {name, simone}.
Age = {age, 26}.
Person = {person, Name, Age}.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: