home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / lisp / mcl / 1322 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  1.0 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!ST7990@SIUCVMB.SIU.EDU
  2. From: ST7990@SIUCVMB.SIU.EDU
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: ff code
  5. Message-ID: <9208270459.AA01970@brazil.cambridge.apple.com>
  6. Date: 27 Aug 92 05:33:20 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 23
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10. Original-To: info-mcl@cambridge.apple.com
  11.  
  12. This question has to do with the c code in
  13. mcl2.0:examples:ff-examples.c. I'd like an explanation of the following
  14. code:
  15.  
  16.            define cdr(x) (* (long *) (x))
  17.  
  18.            define car(x) (* (Ptr *) (((long)(x) + 7)))
  19.  
  20.            define macptr_ptr(x) (*((*Ptr *)
  21.  
  22. These functions can be called by
  23.  
  24.                caller(y)
  25.                long *y;
  26.                { car (*y); cdr(*y); macptr_ptr(*y)}
  27.  
  28. The c function <caller> is defined as
  29.              (deffcfun (caller "caller")((cons :lisp-ref)) :novalue)
  30. and called with
  31.              (caller (cons (_newptr 5) 10)).
  32.  
  33. Thank you.
  34. Chris Ryan (SIUC)
  35.