home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / lisp / 2359 < prev    next >
Encoding:
Text File  |  1992-09-01  |  1.1 KB  |  35 lines

  1. Newsgroups: comp.lang.lisp
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!tulane!lang
  3. From: lang@cs.tulane.edu (Raymond Lang)
  4. Subject: Re: Scheme equivalence in CL
  5. Message-ID: <1992Sep1.234712.23306@cs.tulane.edu>
  6. Sender: news@cs.tulane.edu
  7. Organization: Computer Science Dept., Tulane Univ., New Orleans, LA
  8. References: <gecyA4y00awM4OQVkQ@andrew.cmu.edu>
  9. Date: Tue, 1 Sep 1992 23:47:12 GMT
  10. Nntp-Posting-Host-[nntpd-23262]: okeanos
  11. Lines: 22
  12.  
  13. In article <gecyA4y00awM4OQVkQ@andrew.cmu.edu> Stefan Monnier <sm86+@andrew.cmu.edu> writes:
  14. >In scheme I just would do:
  15. >       (define state-equal equal)
  16. >
  17. >But in common-lisp, the best I found was:
  18. >       (defun state-equal #'equal)
  19. >
  20. >When I call it, CL has no problems: it is recognized as a function,
  21. >it needs 2 parameters, BUT it ALWAYS returns NIL !!
  22. >
  23. >I know I can redefine it more completely:
  24. >       (defun state-equal (x y) (equal x y))
  25. >
  26. >But the scheme way is so much nicer that I'm sure there is an
  27. >equivalent way in CL.
  28.  
  29. The following will copy over a definition:
  30.  
  31. (setf (symbol-function 'state-equal) #'equal)
  32.  
  33. Ray Lang
  34. lang@cs.tulane.edu
  35.