home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / tcl / 1865 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.5 KB

  1. Path: sparky!uunet!ogicse!uwm.edu!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!karl
  2. From: karl@NeoSoft.com (Karl Lehenbauer)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: evalling a string
  5. Message-ID: <BxwHoo.M8I@NeoSoft.com>
  6. Date: 18 Nov 92 07:19:31 GMT
  7. Article-I.D.: NeoSoft.BxwHoo.M8I
  8. References: <1992Nov18.002150.1089@twg.com>
  9. Organization: NeoSoft Communications Services -- (713) 684-5900
  10. Lines: 26
  11.  
  12. In article <1992Nov18.002150.1089@twg.com> "David Herron" <david@twg.com> writes:
  13. >In article <9211171516.AA26302@valiant.src.honeywell.com>,
  14. >jkimball@src.honeywell.com (John Kimball) writes:
  15. >>I can't simply eval the string, because eval wants stuff-stuff to be a
  16. >>command name.
  17.  
  18. >Instead of hacking on `unknown' like Gerald suggested ... it
  19. >would be easy enough to write a new C function which did the variable
  20. >references but otherwise left the string alone.  I can't think of a
  21. >good name, so call it Tcl_ExpandThoseVariableReferences() for now.
  22.  
  23. A command, "expand", originally appeared in Extended Tcl 4.0, which
  24. expanded square-bracketed items and variables, but returned the
  25. result without executing the first element as a command on the
  26. rest of the string as arguments -- just what you're asking for.
  27.  
  28. It fell by the wayside because I couldn't convince John to keep it
  29. when he absorbed arrays, which involved changes in Tcl_Eval anyway.
  30.  
  31. Nothing is lost, however, because you can always do
  32.  
  33.     eval "concat $listIWantToExpand"
  34.  
  35. -- 
  36. -- Email info@NeoSoft.com for info on getting interactive Internet access.
  37. "Turn on your hot tub by email now.  Ask me how."
  38.