home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!eco.twg.com!twg.com!news
- From: "David Herron" <david@twg.com>
- Subject: Re: evalling a string
- Message-ID: <1992Nov18.002150.1089@twg.com>
- Sensitivity: Personal
- Encoding: 18 TEXT , 4 TEXT
- Sender: news@twg.com (USENET News System)
- Conversion: Prohibited
- Organization: The Wollongong Group, Inc., Palo Alto, CA
- Conversion-With-Loss: Prohibited
- Date: Wed, 18 Nov 1992 00:26:02 GMT
- Lines: 23
-
- In article <9211171516.AA26302@valiant.src.honeywell.com>,
- jkimball@src.honeywell.com (John Kimball) writes:
- >I can't simply eval the string, because eval wants stuff-stuff to be a
- >command name. If I use lindex to tease apart the top-level chunks, I lose
- >the information about which chunks were wrapped in double quotes and which
- >ones were wrapped in curly braces. As a workaround, I can define a proc
- >stuff-stuff, but that seems unusually perverse.
- >
- >What am I missing?
-
- Instead of hacking on `unknown' like Gerald suggested (you might want
- to keep unknown's ability to automagically pull in functions) it
- would be easy enough to write a new C function which did the variable
- references but otherwise left the string alone. I can't think of a
- good name, so call it Tcl_ExpandThoseVariableReferences() for now.
-
- Implementation might be as simple as a call to Tcl_ParseWords() but
- would, in any case, start by examining Tcl_Eval() itself.
-
- <- David Herron <david@twg.com> (work) <david@davids.mmdf.com> (home)
- <-
- <- During the '80s Usenet's mantra was: "Not all the world's a VAX".
- <- During the '90s I hope it becomes: "Not all the world's DOS (ick)".
-