home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / sci / math / symbolic / 2196 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  2.0 KB

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