Skip to content
Tcl Source Code Artifact [82442b9c65]
Login

Artifact [82442b9c65]

Artifact 82442b9c65c417a0fd2d6639f3e2fc585b0a66d4:

Ticket change [82442b9c65] - New ticket [684534ffffffffff|684534ffff] <i>[lconvert] command, expands lists inline</i>. by nobody on 2003-02-11 11:46:22.
D 2003-02-11T11:46:22
J assignee msofer
J cmimetype text/plain
J comment \nThis\spatch\sadds\sa\snew\scommand\scalled\s[lconvert]\s\nand\sa\snew\sTcl_ObjType,\s"plist".\s\sA\s"plist"\s\nor\s"parameter\slist"\sis\sidentical\sto\sa\slist\swith\sthe\s\nfollowing\sLARGE\sexception:\s\swhen\sa\s"plist"\sis\sused\s\nin\sANY\scommand,\sit\sis\sexpanded.\s\sThe\ssyntax\sof\s\n[lconvert]\sis\sas\sfollows:\n\nlconvert\svarName\s?type?\n\nwhere\s"varName"\sis\sthe\sname\sof\sa\spre-existing\sLIST\s\nor\sPLIST\svariable\sto\sconvert.\n\nwhere\s"type"\sis\soptional\sand\sif\sspecified,\smust\s\nbe\s"list"\sor\s"plist".\s\s\n\nif\s"type"\sis\somitted,\sthe\scurrent\stype\sof\sthe\slist\s\nvariable\sis\sreturned,\sotherwise,\sthe\snewly\sconverted\s\nlist\sis\sreturned.\n\nan\serror\sis\sreturned\sif\syou\stry\sto\sconvert\sa\snon-list,\s\na\snon-existant\svariable,\sor\sif\syou\stry\sto\sconvert\sa\s\nlist\sto\sthe\stype\sit\scurrently\sis.\n\nWARNING:\sThis\spatch\sMAY\sVERY\sWELL\sbreak\sa\slot\s\nof\sthings.\s\sIt\sis\smeant\sonly\sas\sa\sproof-of-concept.\s\s\nIf\sand\swhen\sall\sthe\squirks\sare\sworked\sout,\sa\sTIP\swill\s\nbe\sforthcoming.\n\n---------------------------------------\n\nFor\sexample:\n\n%\sset\sx\s[list\s1\s2\s3\s4]\n1\s2\s3\s4\n%\slconvert\sx\splist\n1\s2\s3\s4\n%\sfile\sjoin\s$x\n1/2/3/4\n\nNormally,\s[file\sjoin]\stakes\sa\svariable\snumber\sof\s\narguments\sand\sjoins\sthem\stogether\swith\sa\spath\s\nseparator.\s\sIn\sthis\scase,\swe\sonly\spassed\sone\sreal\s\nargument\s(a\s"plist")\sand\sit\swas\sexpanded\s\nautomatically\sto\sfour\s"real\sarguments".\s\sThis\scan\s\nalso\sbe\saccomplished\swith\s[eval],\salthough\sthat\sis\s\nnot\sas\ssafe:\n\n%\sset\sx\s[list\s1\s2\s3\s4]\n1\s2\s3\s4\n%\seval\sfile\sjoin\s$x\n1/2/3/4\n\nFor\smore\sinformation,\splease\ssee\sthe\sWiki\spage\sat:\n\nhttp://wiki.tcl.tk/lconvert\n\n--\nJJM\n
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 45.\sParsing\sand\sEval
J title [lconvert]\scommand,\sexpands\slists\sinline
J type Patch
K 684534ffffffffffffffffffffffffffffffffff
U nobody
Z b7246e62b017605180eae7c15c153f36