home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dove!cam!ARTEMIS
- From: miller@FS1.cam.nist.gov (Bruce R. Miller)
- Newsgroups: sci.math.symbolic
- Subject: Macsyma Lisp: Why %SIN
- Message-ID: <2922719442@ARTEMIS.cam.nist.gov>
- Date: 13 Aug 92 18:30:42 GMT
- Sender: news@cam.nist.gov
- Organization: NIST - Computing and Applied Mathematics Laboratory
- Lines: 39
-
-
- I'm developing a package of special functions for Macsyma and there's
- one thing I haven't been able to sort out to my satisfaction.
-
- First a background question: Why are the standard functions sin, cos,
- etc aliased to %sin, %cos, etc?
-
- It seemed like a nice principal for my own package, because it gave a
- single, simple hook for cleanup. That is to say, you can have short &
- sweet names for the functions, say $FOO, when the package is loaded.
- When you quit macsyma the link between the short names and the internal
- implementation, say %%FOO (an extra % so I dont collide w/ any future
- built-in %FOO ?!?) (particularly the simplifiers) gets broken.
- So in effect, the functions $FOO become undefined. On the one hand,
- short names are more natural & less clutter. On the other, you dont
- want to usurp those names permanently when the package is not being
- used.
-
- [BTW: The cleanup is particularly important in Lisp machine macsyma;
- you never _really_ start up a new macsyma session; the lisp is still
- there, it just gets disconnected from the macsyma names]
-
- So, what's the problem? One thing is that you cant use FOO and then
- load the package; the pre-alias FOO is different from the aliased FOO.
- [this isn't a problem for %SIN, etc, since they're always there]
- And once in a while, for reasons unclear, I've had FOO start printing as
- %FOO.
- And, in general, w/o knowing why its done in other cases, it just seems
- screwy :>
-
- So the question is; Is this the best way to go about it? Would it be
- better to go ahead and define $FOO, and have the cleanup remove the
- OPERATORS property (& if so, hows the best way to do that?).
- Any other ideas, suggestions?
-
- bruce
- miller@cam.nist.gov
-
- [We now return you to the Mma discussion, in progress ....]
-