Classes vs arrays

Ilya Zakharevich <[email protected]>
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <[email protected]>
When do we mean to cease abusing the silicon’s patience?  It is plain silly
to use arrays (of arrays) to store heterogeneous data…

I propose a binary-compatible way to introduce objects:
  • In memory, an object looks exactly like a list — but type() is different.
  • The list’s reserve storage is 1 word.
  • This word is an integer keeping an offset into the array of classes.

From the interpreter, two new methods .iclass and .class is accessible.
They return the index of the class, and the first element of the “content”
of the class (presumably, the name).

⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜

This is an absolute minimum to start the things rolling.  The next thing
would be to recognize different MEANINGS of arrays currently used to pass
info around, and start to convert them to classes.  Then one could start
to think about an interface to create objects/classes from the interpreter…

Ilya
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.