Will Coleda <[EMAIL PROTECTED]> wrote:

> Based on a conversation with Dan in IRC, it should be possible to
> interrogate PMCs about their generic type.

> For example, tcl's [array exists varName] returns true if the variable
> is defined /and/ is an array variable (in perl-speak, a hash).

> But, there's no easy way to ask a PMC, "are you hashlike?".

Ha?

$ cat does.imc
.sub main @MAIN
    $P0 = new Array
    $I0 = does $P0, "array"
    print $I0
    $P1 = new PerlHash
    $I0 = does $P1, "hash"
    print $I0
    print "\n"
    $I0 = does $P1, "array"
    print $I0
    $I0 = does $P0, "hash"
    print $I0
    print "\n"
.end

$ ./parrot does.imc
11
00

leo

Reply via email to