Comments (4)
According to the CLOS MOP specification, the primary method for compute-applicable-methods-using-class is specialized on standard-generic-function, not generic-function. See https://franz.com/support/documentation/10.1/doc/mop/dictionary.html#compute-applicable-methods-using-classes
from closer-mop.
How about defaulting to cl:standard-generic-function
rather than c2mop:standard-generic-function
?
Defaulting to c2mop:standard-generic-function
is bit annoying because,
it causes unsynmetric behavior between compute-applicable-methods
and compute-applicable-methods-using-classes
(on LispWorks 8)
(c2mop:defclass C () ())
(c2mop:defmethod M ((I C)))
(c2cl:compute-applicable-methods #'M (list (c2cl:class-prototype (find-class 'C))))
→ (#<standard-method m nil (c) 801025DE43>)
(c2cl:compute-applicable-methods-using-classes #'M (list (find-class 'C)))
>>>error: No applicable methods for #<lisp:standard-generic-function compute-applicable-methods-using-classes 826081B6E9> with args
IMHO most of c2mop:defgeneric
or c2mop:defmethod
usage is without explicit (:generic-function-class c2mop:standard-generic-function)
option.
and c2mop:defgeneric
sets implicit default to cl:standard-generic-function
rather than c2mop's GF.
from closer-mop.
The CLOS MOP imposes a number of restrictions what portable programs can and cannot do. Adding methods to predefined metaobject classes is generally not a good idea. It might work in this particular case, but it might not work in others, and it's better to be consistent.
The defaults for defclass and defgeneric are chosen so that if you don't choose and explicit :metaclass or :generic-function-class, you get something that primarily performs well, which means falling back to the built-in metaobject classes. The CLOS MOP is primarily designed for defining your own metaobject classes, and then you have to use :metaclass and :generic-function-class anyway.
You can also :use :closer-common-lisp, and then CLOS-related symbols are taken from c2mop instead of cl.
I know that invoking compute-applicable-method-using-classes is inconvenient if you don't have your own metaobject classes defined, but that's actually not its main purpose anyway. The main purpose is to change how applicable methods are determined for your own generic function metaobject class.
Can't you just use compute-applicable-methods? What's your use case?
from closer-mop.
Thank you for your explaining design choices about closer-mop.
I will just use compute-applicable-methods
.
Much appreciated.
from closer-mop.
Related Issues (17)
- writing a test code HOT 6
- Darcs repository - dates HOT 3
- Documentation and internal symbol exports HOT 9
- Bad conditionalization for lispworks with-hash-table-locked HOT 8
- Problem with closer-mop::only-standard-methods. HOT 8
- Default make-method-lambda doesn't add implicit blocks around the method body. HOT 5
- closer-mop breaks defclass in LispWorks HOT 4
- Build failure with ECL 21.2.1 HOT 2
- slot-boundp-using-class broken in LispWorks 8? HOT 10
- `mop-features` should be more prominent, and why not integrate it into `closer-mop` as a separately loadable ASDF system? HOT 3
- compute-effective-method-function does not expand implementation-specific macros HOT 1
- [non-conformance] closer-mop shadows call-next-method in make-method-lambda HOT 2
- irregurality on ABCL HOT 2
- Redefined standard-generic-function. HOT 1
- No applicable method for "compute-applicable-methods-using-classes" for ccl on OSX. HOT 2
- Reader functions for method-combination class HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from closer-mop.