home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / lisp / mcl / 1988 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.6 KB  |  59 lines

  1. Newsgroups: comp.lang.lisp.mcl
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!howland.reston.ans.net!spool.mu.edu!yale.edu!ira.uka.de!fauern!dec16!wina65.informatik.uni-wuerzburg.de!user
  3. From: poeck@informatik.uni-wuerzburg.de (karsten poeck)
  4. Subject: call-next-method
  5. Message-ID: <poeck-120193114641@wina65.informatik.uni-wuerzburg.de>
  6. Followup-To: comp.lang.clos
  7. Sender: news@informatik.uni-wuerzburg.de (USENET News account)
  8. Organization: university of wuerzburg
  9. Date: Tue, 12 Jan 1993 10:43:58 GMT
  10. Lines: 47
  11.  
  12. Is it really correct if a compiler warns in the following code
  13.  
  14. (defclass test ()
  15.   ()
  16.   )
  17.  
  18. (defmethod testmethod ((ich test) foo)
  19.   (print foo))
  20.  
  21. (defclass test-1 (test)
  22.   ())
  23.  
  24. (defmethod testmethod ((ich test-1) foo)
  25.   (call-next-method))
  26.  
  27. (testmethod (make-instance 'test-1) 4)
  28.  
  29. with 
  30. ;Compiler warnings :
  31. ;   Unused lexical variable Foo, in Testmethod.
  32.  
  33. since foo is actually used in testmethod ((ich test) foo)
  34. because of the call-next-method?
  35.  
  36. My problem is that Macintosh Common Lisp 2.0 warns but
  37. Allegro Cl/PC 1.0 does not and I have to exchange code
  38. between the two platforms. Even worse, if I change
  39.  testmethod ((ich test-1) foo) to
  40.  
  41. (defmethod testmethod ((ich test-1) foo)
  42.   (declare (ignore foo))
  43.   (call-next-method))
  44.  
  45. Macintosh Common Lisp 2.0 is satisfied but Allegro Cl/PC 1.0
  46. complains that foo is actually used and not ignored, so I have to write
  47.  
  48. (defmethod testmethod ((ich test-1) foo)
  49.   #+:ccl-2 (declare (ignore foo))
  50.   (call-next-method))
  51.  
  52. what is quite annoying, since this code is really not platform-dependent
  53.  
  54. Karsten
  55.  
  56. Karsten Poeck
  57. Universitaet  Wuerzburg
  58. Lehrstuhl fuer Informatik VI
  59.