home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / tcl / 1859 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.6 KB  |  38 lines

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