Re: A subst-antial question



On 2006-04-28 09:01:16 -0400, John Seal <sealj@xxxxxxxxxxxxxxxxx> said:

Dan Smart wrote:
I'm also going to take this opportunity to whine about how you can't create a multi-statement list and eval it.

You must mean something else.

% set multiStatementList {
> set foo(a) 1
> set foo(b) 2
> }
That isn't a list, it's a string, that happens (unlike many others) to be convertable to a list.

I *do* understand what you mean about [list] escaping semicolons. My solution has always been to build the script as a string and [append] the semicolons instead of [lappend] them. The [join $listOfLists ";"] solution also treats the script and the semicolons as strings.

And is hence broken, well the not actually working bit is the real kicker, but if it did, the conversion to string would be pretty annoying.

And it matters because unless you can treat scripts as lists, safely operating on them is very (very) difficult.

Dan

.



Relevant Pages

  • TOC of Python Cookbook now online (was Re: author index for Python Cookbook 2?)
    ... Processing a String One Character at a Time ... Finding a File on the Python Search Path ... Constructing Lists with List Comprehensions ... Looping over Items and Their Indices in a Sequence ...
    (comp.lang.python)
  • ANN: MeObjects Library for Delphi
    ... object type small and powerful. ... the Object instance can use the ClassType method return the ... Especially for lists of pointers to dynamically allocated memory. ... {Summary Adds Ansi String and correspondent object to a list. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: problem evaluating if { ! [file exists $DIRVAL]} inside script
    ... I wrote the following code in a small script and verified it worked. ... array set mydirlist {[list $string]} ... set currpath [concat $currpath1$mydirlist] ... Even though it is documented to accept strings, it treats the strings as lists and often doesn't do what you intend. ...
    (comp.lang.tcl)
  • Filling a grid with Sharepoint data
    ... /// Retrieves a Lists web service proxy with default settings. ... string strComputerName = System.Net.Dns.GetHostName.ToLower; ... XmlDocument xmlDoc, ... XmlElement elementMethod, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Code for List Boxes
    ... I also had to add a closing parentheses to strWhere = ... Dim strWhere As String ... Dim varSelected As Variant ... when you've selected values from the two lists? ...
    (microsoft.public.access.modulesdaovba)