This file was automatically generated from http://svn.pugscode.org/pugs/docs/notes/builtin_types_and_extenstion.pod on Wed Jun 6 22:16:47 2007 GMT, revision 16639.
Built-in types and their extension
(Sorry, just scribbled down for now, will fill out later)
so, lets examine Array for a moment in isolation ...
Array is defined as a role. Array does List (List being a role which provides the more "functional" things like &map, &grep, &reduce, etc.).
So, we don't yet have a class(Array) only a role(Array), but before I define class(Array) I want to describe how role(Array) could be used. The role(Array) can be "does"-ed by other classes, which will give them class(Array) like behavior. This is instead of subclassing class(Array).
So in all cases where you would want to subclass class(Array), you can does the role(Array) instead, and the results will be (almost) exactly the same. If you need MI, or something which really needs to be subclassed then you can hack it together with role(Array).
the idea is that we create a class(Array) which implements the <[]> part, and then finalize that class
basically forcing the "extension of built in types" to always be done using roles
and the undef-but-behavioural ::Array in userland is proxy for _both_
I think we can make the $repr=nil classes deal with does() and is() in an approriate way
http://colabti.de/irclogger/irclogger_log/perl6?date=2006-01-18,Wed&sel=302#l538
Stevan Little <stevan@iinteractive.com>