[Types-sig] Q: What are Meta-classes anyhoo?

John Skaller skaller@maxtal.com.au
Sat, 05 Dec 1998 00:45:02 +1000


At 14:10 3/12/98 -0600, Evan Simpson wrote:

>8. Another point of view (Mr. Skaller's, I think) is that class objects
>build instance objects, albeit in a fairly passive way.  Thus, meta-classes
>should build classes, but in a more active fashion than simply acting as a
>template/default-attribute map (which base classes do anyhow).  I have vague
>visions of filling in class methods by combining sub-function code snippets
>in interesting ways.

        to give a concrete example from an exitsing language:

        template<class T> class list { ... }

You see that 'list' is a meta-class. It is something
which _constructs_ classes.

You will note that C++ has a serious limitation: there is no
meta-meta-class which constructs meta-classes. This is needed.
For example, to construct a 'product' object you need
something like:

        template<class I> class struct<i> {
                for i in I 'T(i) val(i);'
        }

I have done this: I had to write a C program to generate the
header files for the first n values of i.

        I good Python solution would not have the C++ restriction.
-------------------------------------------------------
John Skaller    email: skaller@maxtal.com.au
		http://www.maxtal.com.au/~skaller
		phone: 61-2-96600850
		snail: 10/1 Toxteth Rd, Glebe NSW 2037, Australia