home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / tcl / 2201 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.2 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!spool.mu.edu!agate!saffron.CS.Berkeley.EDU!joel
  2. From: joel@saffron.CS.Berkeley.EDU (Joel A. Fine)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: Advice wanted on math functions for Tcl 7.0
  5. Date: 22 Dec 1992 02:26:10 GMT
  6. Organization: UC Berkeley, Computer Science Division
  7. Lines: 22
  8. Distribution: world
  9. Message-ID: <1h5uc2INNljk@agate.berkeley.edu>
  10. References: <1h5pseINNkvu@agate.berkeley.edu>
  11. NNTP-Posting-Host: saffron.cs.berkeley.edu
  12.  
  13. In article <1h5pseINNkvu@agate.berkeley.edu>, ouster@sprite.Berkeley.EDU (John Ousterhout) writes:
  14. |> There are two possible ways to implement math functions: embedded into
  15. |> expr or as separate commands.
  16.  
  17. A comment:
  18.  
  19. If they are embedded into expr, it is trivial to generate the separate commands later:
  20.  
  21. proc sin {n} {
  22.   return [expr {sin($n)}]
  23. }
  24.  
  25. A library tcl file that enumerates each of the math functions could be shipped
  26. with the standard release of tcl, and optionally sourced. This way both alternatives
  27. could be accomodated.
  28.  
  29. I don't see a simple way to emulate the expr-embedding approach using function
  30. definitions. If other considerations leave it a toss-up, I'd go with embedding it
  31. into expr for this reason.
  32.  
  33. - Joel Fine
  34. joel@cs.berkeley.edu
  35.