RE: [tcltk-perl] Drop listify [PATCH]
Brought to you by:
hobbs
From: Konovalov, V. <vko...@sp...> - 2004-04-14 12:48:23
|
To be honest, I did not tried that Jeff's subroutine yet, but why do you think it should not be included? AFAIU it is used in perlTk compatibility widgets implementation. > 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); > } > } > } > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Tcltk-perl mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcltk-perl > |