# New Ticket Created by  Will Coleda 
# Please include the string:  [perl #28393]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=28393 >


Attached, find a .tgz that can be exploded in the top level of parrot 
which creates the abstract pmc "tclobject", with children "TclString", 
"TclInt", "TclFloat", and container pmcs "TclList" (an array) and 
"TclArray" (a hash).

Tcl{String,Int,Float} work like their Perl counterparts, and, to use 
tcl parlance, "shimmer" to the appropriate type as necessary.

This was basically a cut and paste job from the various Perl versions, 
so there will be future patches (and, er, tests - someone let me know 
if the tests belong in languages/tcl or if I should follow perl's lead 
and put them in parrot's test dir) to these classes to eventually make 
them even more tcl-ish (including automatic conversion between the 
array and the string), but this'll let me rip out all references to 
Perl in languages/tcl, which is a good thing.

The biggest thing which I tripped over here was that Array.pmc uses 
PerlUndef to shimmer a few of the types. So, when I did:

$P1 = new TclList
$P1[0] = "eek"
$P2 = $P1[0]
$S0 = typeof $P2
print $S0

I'd get PerlString, because of inherited methods from Array.pmc. I just 
had to override those methods. (basically a cut and paste-o, changing 
the PerlUndef to a TclString, since that shimmers to the right types.)

I now have commit privs to languages/tcl (thanks!), so I have some 
local updates that are waiting on this getting in.

A re-configure/make is necessary to be able to use the Tcl* pmcs if 
you're feeling adventurous.

Attachment: tcl_pmc.tar.gz
Description: GNU Zip compressed data


--
Will "Coke" Coleda                                    will at coleda 
dot com

Reply via email to