cd dynclasses && make
runtime/parrot/dynext/tclgroup.so (or something like it.) (If you don't, there's a bug, and please report it
to the perl6 internals list. )
Now, at the top level parrot directory, you can create
loadlib $P0, "tclgroup" # Load combined tcl lib
$I0 = find_type "TclInt" # Find ID for a TclInt *
$P0 = new $I0 # Instantiate
$P0 = "asdf" # Assign
$S0 = typeof $P0 # Get the type description.
This snippet prints out
Note that the type of the PMC has
shimmered (morphed, if you prefer) to the appropriate data type. I need to do
more work to nail down the appropriate reactions for each kind of shimmer for
puts '[string range [list 1 2 3] 0 2]'
which will have been shimmered from a TclList (returned by [list]) to a TclString
[*] - these steps are, of course, unnecessary with built in types. They're
necessary here because when parrot started, we didn't know anything about Tcl.
We have to load the pmcs, and then, because the pmc types were created at
runtime, we have to use a runtime check to get our class ID. (As opposed to
the builtin type
String, which you can, thanks to
runtime/parrot/include/pmctypes.pasm, just create with
$P0 = new String)