id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	lang	patch	platform
789	Make All PMCs Subclassable	whiteknight	whiteknight	"Several core PMC types are not subclassable because they have attributes that are not the ""register"" types (P, S, N, I). What happens is that the subclass operation acts like normal, but Objects of the resultant class are not usable for normal operations.

Some examples:
 - FileHandle (see #681)
 - ExceptionHandler (See #154)

Any other PMC type that uses a non-subclassable ATTR will have the same problem, although to my knowledge no tickets for these have been opened yet. 

I had been working in #681 in a branch, but after talking with Allison we decided that the approach had the right idea but the wrong implementation. 

From IRC today (paraphrased):

{{{
allison> give PIR Classes the ability to create a delegate or proxy structure for ATTRs that aren't register types
allison> the basic problem is, attributes in PIR Classes are stored in an array
allison> That array can only have PMC elements
allison> so, it knows how to box and unbox the basic register types
whiteknight> so do something like box C types into ManagedStruct or something similar?
allison> the best place to start is probably with a list of C types in the current C PMCs, and how they can be represented as a PMC
}}}

See the whole discussion here: [http://irclog.perlgeek.de/parrot/2009-06-24#i_1263385]

So here's a quick list of tasks that we can do to fix this problem:

 - Get a list together of all ATTRs in built-in PMC types that are not INTVAL, FLOATVAL, STRING* or PMC*
 - Determine how to store each of those types in PMCs. This could mean using ManagedStruct or UnmanagedStruct, Pointer, CPointer, or some new type entirely
 - Teach the GETATTR/SETATTR macros how to access values that are boxed like this.

This whole process probably requires a little bit more thought and planning, I'll try to create a page on the wiki somewhere so that we can plan this in more detail.
"	todo	closed	blocker		core	master	medium	wontfix	pmc subclass				all
