home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / lisp / lispnews / text0282.txt < prev    next >
Encoding:
Text File  |  1985-11-10  |  1.5 KB  |  35 lines

  1. My problem was a bit simplier then the general case you mention. In MRS
  2. a 'variable' is really a reader-macro ($) that at read time assigns a special
  3. value to each variable-base-name. Basically it does a
  4.     (set (implode `(|$| . ,(explodec name))) 'bl).
  5. for side-effects of marking the symbol as a variable.  When compiling files
  6. containing MRS code the compiler would execute the call inside its environment,
  7. placing the *unbound* literals (as .asciz) in the object file to be READ
  8. in at load time... so MRS would get the symbols and treat them as symbols
  9. not variables.
  10.  
  11. The only reason i mention this is that the workaround used might be useful
  12. for others seeking side effects within macros etc.
  13. My workaround (h.a.c.k) was to use a special variable
  14.     liszt-eof-forms
  15. as a queue of the above SET forms and to provide a different macro expansion
  16. for compile-time.  So
  17.  
  18. (setsyntax '|$| 'macro
  19.   #'(lambda nil (let ((varname (implode `(|$| ,@(explodec (read))))))
  20.              (addq `(setq ,varname 'bl) liszt-eof-forms)
  21.              varname)))        ;; return variable name to liszt!
  22.  
  23. [where ADDQ does the correct thing if the variable has already been seen],
  24. adds the following to the object file
  25.     .asciz "$xyz"
  26.     .asciz "(setq $xyz 'bl)"
  27. which basically works (don't gag!)
  28.                     steve white
  29.  
  30. YAP -- (yet another problem) : does anyone at MIT have a list of fixes
  31. to franz 38.91 to make the zeta-lisp environment work :-) I started fixing
  32. a few things but it looks like something that might MIT may have already
  33. done. ((or any plans to put NIL under UNIX? 8-) ))
  34.  
  35.