Author: allison
Date: Sun Apr 1 19:55:18 2007
New Revision: 17940
Modified:
trunk/docs/pdds/draft/pdd04_datatypes.pod
trunk/docs/pdds/draft/pdd15_objects.pod
Log:
[pdd]: Add notes about subclassing low-level PMCs as high-level objects.
Modified: trunk/docs/pdds/draft/pdd04_datatypes.pod
==============================================================================
--- trunk/docs/pdds/draft/pdd04_datatypes.pod (original)
+++ trunk/docs/pdds/draft/pdd04_datatypes.pod Sun Apr 1 19:55:18 2007
@@ -199,7 +199,7 @@
more) types of PMC, while particular Python datatypes will map onto different
types of PMC.
-=head2 VTABLE OVERLOADING
+=head2 Vtable Overloading
PMCs may declare vtable methods. The following list details the raw method
names:
@@ -574,6 +574,11 @@
=back
+=head2 Interaction between PMCs and high-level objects
+
+{{ Address the problem of high-level objects inheriting from low-level PMCs,
+and any structural changes to low-level PMCs that might require. }}
+
=head1 ATTACHMENTS
Modified: trunk/docs/pdds/draft/pdd15_objects.pod
==============================================================================
--- trunk/docs/pdds/draft/pdd15_objects.pod (original)
+++ trunk/docs/pdds/draft/pdd15_objects.pod Sun Apr 1 19:55:18 2007
@@ -119,13 +119,15 @@
=item - Objects can fetch their class
+=item - Objects can get an attribute by name
+
+=item - Objects can set an attribute by name
+
=item - Objects can be subclassed (note that objects may not necessarily
be able to have their classes changed arbitrarily, but making a subclass
and moving the object to it is allowable)
-=item - Objects can get an attribute by name
-
-=item - Objects can set an attribute by name
+=item - High-level objects can subclass low-level PMCs
=back
@@ -345,6 +347,12 @@
required positional parameter, and the optional named parameters C<exclude>
and C<alias>; see L<Role Conflict Resolution> for more details.
+=item subclass
+
+ $P1 = $P2.subclass($S3)
+
+Create a subclass of $P2 with name $S3 and return it in $P1.
+
=item isa
$I1 = $P2.isa($S3)
@@ -405,7 +413,6 @@
and no Namespace object referencing it (to mark it as live). When a
class is garbage collected, it should remove itself from the registry.
-
=head2 Object PMC API
C<Object> PMCs are the actual objects, and hold all the per-object
@@ -574,7 +581,7 @@
implement them.
When declaring a composed class, you can optionally supply an array of
-method names that will be supplied by the class because of a conflict in
+method names that will be defined by the class to resolve a conflict in
its roles. This is done using the named parameter C<resolve>. This
feature supports composition conflict resolution in languages such as
Perl 6.
@@ -663,7 +670,9 @@
$P1 = subclass $P2, $S3
-Create a new class, named $S3, which has $P2 as its immediate parent.
+Create a new class, named $S3, which has $P2 as its immediate parent. $P2 may
+be either another high-level class based on the Class PMC, or it may be a
+low-level PMC such as C<Integer> or C<ResizablePMCArray>.
=item get_class
@@ -1036,17 +1045,7 @@
Should we have a super or next opcode?
-=head1 NOTES
-
-=head2 Interaction with PMCs
-
-The interaction between objects and PMCs is currently underspecified.
-
-{{ Question: Does anyone remember what this note was about? Was it the
-problem of high-level objects that inherit from low-level PMC objects?
-}}
-
-
+{{ Shouldn't that be a super or next method call instead? }}
=head2 Translation