home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / clos / 1006 < prev    next >
Encoding:
Text File  |  1992-11-20  |  3.3 KB  |  74 lines

  1. Newsgroups: comp.lang.clos
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sra.COM!peterson
  3. From: peterson@sra.COM (Eric Peterson x7644)
  4. Subject: Extending syntax/semantics of method specializers
  5. Message-ID: <9211210425.AA12235@verdi.iisd.sra.com>
  6. Sender: daemon@cis.ohio-state.edu
  7. Organization: The Ohio State University Department of Computer and Information Science
  8. References: <1992Nov20.221251.28590@jpl-devvax.jpl.nasa.gov>
  9. Date: Sat, 21 Nov 1992 04:25:35 GMT
  10. Lines: 62
  11.  
  12. >>>>> On Fri, 20 Nov 1992 22:12:51 GMT, charest@Aig.Jpl.Nasa.Gov (Len
  13. Charest) said:
  14. Proposal: I propose the following additions to the MOP (as described in AMOP). 
  15. If the processing of DEFMETHOD (as described on p 149-150 in AMOP) were 
  16. revised to include use of these functions then I'd have a portable way of 
  17. writing satisfies-specializers.
  18.  
  19. SPECIALIZER-OBJECT (specializer-name)                       [Generic Function]
  20.   This generic function returns the specializer object associated with
  21. specializer-name. 
  22. SPECIALIZER-OBJECT ((specializer-name symbol)                         [Method]
  23.   This method calls (FIND-CLASS specializer-name).
  24. SPECIALIZER-OBJECT ((specializer-name list))                          [Method]
  25.   This method calls (TYPE-SPECIALIZER-OBJECT (CAR specializer-name) (CDR
  26. specializer-name)). The value returned by TYPE-SPECIALIZER-OBJECT is the value
  27. returned by this function.
  28.  
  29. TYPE-SPECIALIZER-OBJECT (type-specifier subsidiary-info)    [Generic Function]
  30.   This generic function returns the specializer object associated with the
  31. given type-specifier and its subsidiary-info.
  32. TYPE-SPECIALIZER-OBJECT ((type-specifier (eql 'eql)) subsidiary-info  [Method]
  33.   This method calls (INTERN-EQL-SPECIALIZER (CAR subsidiary-info)).
  34. TYPE-SPECIALIZER-OBJECT ((type-specifier (eql 'satisfies))            [Method]
  35.                          subsidiary-info)
  36.   This method computes the satisfies-specializer object associated with the 
  37. given subsidiary-info.
  38. <<<<<<<<<[end of cite]
  39.  
  40.  
  41. Hi Len;
  42.  
  43.    I think you've hit on a good area in which specialization could be
  44. beefed up.  One thought occurred to me when wishing for more
  45. specialization power of this sort a while back:
  46.  
  47.    Since the EQL specializer has its roots in the EQL type specifier,
  48. why not allow specialization using any type specifier such as MEMBER,
  49. OR, (INTEGER 5 10), etc.  EQL would become just one of many type
  50. checking specializers which would conceivably even share the same
  51. specializer metaobject.  This specializer might be named something
  52. like TYPE-SPECIFIER-SPECIALIZER and would replace and subsume
  53. EQL-SPECIALIZER.
  54.  
  55.    The implementation would simply call
  56. (TYPEP <gen-fun-arg> <type-specifier>) during generic dispatch.  This
  57. approach would eliminate the need for the TYPE-SPECIALIZER-OBJECT
  58. generic function.
  59.  
  60.    Any further thoughts?  Perhaps I'm unaware of reasons for allowing
  61. EQL-SPECIALIZER to be its own metaobject or any number of other things
  62. ;^>.
  63.  
  64.  
  65.                                    Eric Peterson (speaking for myself)
  66.                                    Systems Research and Applications
  67.                                    2000 15th Street North
  68.                                    Arlington, VA 22201
  69.                                    USA
  70.                                    peterson@sra.com
  71.                                    (703) 558-7644
  72.                                    Fax:  (703) 558-4723
  73.  
  74.