Dan Sugalski wrote:

> At 9:51 AM +0200 9/13/02, Leopold Toetsch wrote:
> 
>> and is a perl6 %h{"a"}[0][1] a PASM P2["a";0;1]?
> 
> Yes.

Fine, thought so too, thanks for your quick answer.

I have already a patch for it, I'll make an entry in t/pmc/perlhash.t too.

_But_:

What about all these bogus additional vtable methods of e.g. PerlHash, 
that are currently implemented, or have dummy function bodies?

My proposal:

- get rid of them, _all_. If one wants multiply two hashes, he can 
implement a _meaningful_ method. Add and subtract could be useful, but 
not with the current implementation.

- get_string returns "PerlHash[0xpmcaddr]"

- let the default.pmc, where all these non existent methods will end, 
through an appropriate execption.

- if any pmc needs a functionality from current default.pmc, then:
  - copy default.pmc to defaultscalar.pmc
  - and let these PMCs inherit from this class.

(default.pmc works now similar to PerlUndef, but tries to do something 
meaningful, e.g. get_integer, but all classes I looked at do have there 
own get_integer.)

- default.pmc shoud be number #0 in the PMC enumeration, so that an 
lookup of a non existant PMC class will return 0 (as it doese now) but - 
this class is not valid.

- default.pmc could be renamed to invalid.pmc, to make clear, what the 
intent is.

leo

Reply via email to