From csr21 at cam.ac.uk Fri Oct 1 15:23:37 2004 From: csr21 at cam.ac.uk (Christophe Rhodes) Date: Fri, 01 Oct 2004 16:23:37 +0100 Subject: [Small-cl-src-discuss] Re: small mop compatability layer References: Message-ID: marco writes: > The mopp package also exports the function > SLOT-DEFINITION-DOCUMENTATION which while not strictly part of > the MOP really should be and is implementened on most systems. It surprises me slightly that you think that SLOT-DEFINITION-DOCUMENTATION shouldn't be a generic function. > IMPLEMENTATION - A keyword indetifying the implementation, one > of: :OPENMCL, :SBCL, :CMU, :LISPWORKS. > (let ((external-symbols '())) > (do-external-symbols (sym (find-package :it.bese.arnesi.mopp)) > (push sym external-symbols)) > (dolist (sym external-symbols) > (unless (provide-mopp-symbol sym #+openmcl :openmcl > #+sbcl :sbcl > #+cmu :cmu > #+lispworks :lispworks) > (warn "Unimplemented MOP symbol: ~S" sym)))) You could be slightly nicer to other implementations by doing ... (unless (provide-mopp-symbol sym (or #+openmcl :openmcl #+sbcl :sbcl #+cmu :cmu #+lispworks :lispworks :unimplemented)) (warn ...)) and either provide a method on :unimplemented or a method on NO-APPLICABLE-METHOD. > (defmethod provide-mopp-symbol ((symbol symbol) > (implementation (eql :sbcl))) > (when (find-symbol (string symbol) :sb-pcl) > (import-to-mopp (find-symbol (string symbol) :sb-pcl)))) Unless there's a reason not to, you should be using the "SB-MOP" package here. (If there is a reason, sbcl-devel wants to know about it!) Cheers, Christophe From mb at bese.it Fri Oct 1 16:27:30 2004 From: mb at bese.it (Marco Baringer) Date: Fri, 01 Oct 2004 18:27:30 +0200 Subject: [Small-cl-src-discuss] Re: small mop compatability layer In-Reply-To: (Christophe Rhodes's message of "Fri, 01 Oct 2004 16:23:37 +0100") References: Message-ID: Christophe Rhodes writes: > marco writes: > >> The mopp package also exports the function >> SLOT-DEFINITION-DOCUMENTATION which while not strictly part of >> the MOP really should be and is implementened on most systems. > > It surprises me slightly that you think that > SLOT-DEFINITION-DOCUMENTATION shouldn't be a generic function. on openmcl and lispworks it is. on other lisps it's a wrapper around a generic function, what's to be gained? > You could be slightly nicer to other implementations by doing > ... (unless (provide-mopp-symbol sym (or #+openmcl :openmcl > #+sbcl :sbcl > #+cmu :cmu > #+lispworks :lispworks > :unimplemented)) > (warn ...)) > and either provide a method on :unimplemented or a method on > NO-APPLICABLE-METHOD. good idea. > Unless there's a reason not to, you should be using the "SB-MOP" > package here. (If there is a reason, sbcl-devel wants to know about > it!) the symbol metaobject exists in sb-pcl (though it does not name a class), it doesn't exist in sb-mop. [hence the Cc to sbcl-devel]. -- -Marco Ring the bells that still can ring. Forget your perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen