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