home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / lisp / mcl / 1835 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.3 KB  |  33 lines

  1. Newsgroups: comp.lang.lisp.mcl
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!dog.ee.lbl.gov!hellgate.utah.edu!hellgate!moore
  3. From: moore@cs.utah.edu (Tim Moore)
  4. Subject: Re: non quoted arguements
  5. Message-ID: <MOORE.92Dec14100254@defmacro.cs.utah.edu>
  6. In-reply-to: bright@ENH.NIST.GOV's message of 14 Dec 92 15:24:08 GMT
  7. Organization: University of Utah CS Dept
  8. References: <01GSAWG9D45U001D1T@ENH.NIST.GOV>
  9. Date: 14 Dec 92 10:02:54
  10. Lines: 21
  11.  
  12. In article <01GSAWG9D45U001D1T@ENH.NIST.GOV> bright@ENH.NIST.GOV writes:
  13.  
  14.    How does one write a function/macro/anything to return the input, like the
  15.    old nlambdas and fexpers used to do?  The reason:  I'd like to track what I
  16.    do without having to quote everything.  Say, track-it, which returns the
  17.    value of foo, but pushes the symbol foo onto a list:
  18.  
  19.    (setq bar '(a list with data))   (defparameter *all-new-names* '(some old
  20.    names too))
  21.    (track-it bar) --> (a list with data), and   *all-new-names* = (bar some
  22.    old names too)
  23.  
  24. (defmacro track-it (name)
  25.   `(progn
  26.      (pushnew ',name *all-new-names*)
  27.      ,name))
  28.  
  29. --
  30. Tim Moore                    moore@cs.utah.edu {bellcore,hplabs}!utah-cs!moore
  31. "Wind in my hair - Shifting and drifting - Mechanical music - Adrenaline surge"
  32.     - Rush
  33.