[tcltk-perl] Drop listify [PATCH]
Brought to you by:
hobbs
From: Gisle A. <gi...@Ac...> - 2004-04-14 09:41:20
|
This patch seems like a good idea to me. --Gisle Index: Tcl.pm =================================================================== RCS file: /cvsroot/tcltkce/Tcl/Tcl.pm,v retrieving revision 1.9 diff -u -p -u -r1.9 Tcl.pm --- Tcl.pm 12 Apr 2004 23:09:56 -0000 1.9 +++ Tcl.pm 14 Apr 2004 09:18:45 -0000 @@ -302,28 +302,6 @@ sub LINK_READ_ONLY () { 0x80 } bootstrap Tcl; -# This is a crude list-creating routine. 'icall' convert perl array -# refs into Tcl list objects efficiently, so this isn't necessary. -# It is also not "comprehensive", so should be used as a last resort. -sub listify { - my $res; - for my $arg (@_) { - my $ref = ref($arg); - $res .= " " if $res; - if (!$ref && $arg =~ / /) { - $res .= "{$arg}"; - } - elsif ($ref eq "ARRAY") { - $res .= "{" . listify(@$arg) . "}"; - } - else { - $arg =~ s/\\/\\\\/g; - $res .= $arg; - } - } - return $res; -} - #TODO make better wording here # %anon_refs keeps track of anonymous subroutines that were created with # "CreateComand" method during process of transformation of arguments for @@ -386,12 +364,6 @@ sub call { # XXX needs testing $args[$argcnt] = $interp->create_tcl_sub(sub {$arg->[0]->(@$arg[1..$#$arg])}); - } - else { - # Do nothing here, as icall recurses into ARRAYs and - # turns them into true Tcl lists - # Should properly turn ARRAY into Tcl list - #$args[$argcnt] = listify(@$arg); } } } |