Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]> wrote: > Leopold Toetsch wrote: >> Dan Sugalski <[EMAIL PROTECTED]> wrote: >>>We need the ability to layer PMCs. Nothing new, we need something of >>>the sort for transparent read-only-ness and probably thread-safety >> >> What about the current implementation [1]: >> * PMCs that have read-only variants have the C<const_too> flag set >> * the PMC compiler creates a second set of vtables with all mutating >> vtable slots set to functions that throw exceptions
> Combinatorial explosion. This already requires four variants (normal, > const, threadsafe, const threadsafe), and we haven't even seen what real > users will want to do with PMCs yet. Not quite. A const PMC is already thread-safe. But there are basically 3 variants of a PMC, yes. The question is, if these need distinct PMC types (which would need separate MMD slots), or if we can find a scheme to just attach a different vtable, that does the right thing. > ... (I could imagine, for example, > people wanting to push a transcoding layer onto a string or aggregate > PMC, which forces all incoming strings into a certain encoding. Or a > layer that lowercases incoming keys. Or, or, or...) These layers are implemented at the IO level as I/O layers. If such a layer should really be PMC specific, it could be implemented as a distinct object. leo