Comments (2)
For what it's worth, it doesn't work in CLISP in Windows when I tried it there. See further comments below Nigel
viz.
[1]> (make-instance 'standard-method :lambda-list '(foo) :function #'(lambda (foo) foo))
*** - (INITIALIZE-INSTANCE STANDARD-METHOD): Missing :SPECIALIZERS argument.
The following restarts are available:
ABORT :R1 Abort main loop
Full session:
i i i i i i i ooooo o ooooooo ooooo ooooo
I I I I I I I 8 8 8 8 8 o 8 8
I \ +' / I 8 8 8 8 8 8 \
-+-' / 8 8 8 ooooo 8oooo
`-|-' 8 8 8 8 8
| 8 o 8 8 o 8 8
------+------ ooooo 8oooooo ooo8ooo ooooo 8
Welcome to GNU CLISP 2.48 (2009-07-28) http://clisp.cons.org/
Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2009
Type :h and hit Enter for context help.
[1]> (make-instance 'standard-method :lambda-list '(foo) :function #'(lambda (foo) foo))
*** - (INITIALIZE-INSTANCE STANDARD-METHOD): Missing :SPECIALIZERS argument.
The following restarts are available:
ABORT :R1 Abort main loop
Break 1 [2]>
Regarding how SBCL is handling specializers we have
CL-USER> (setf return (make-instance 'standard-method :lambda-list '(foo) :function #'(lambda (foo) foo)))
#<STANDARD-METHOD () {1003809DD3}>
CL-USER> (describe return)
#<STANDARD-METHOD () {1003809DD3}>
[standard-object]
Slots with :INSTANCE allocation:
SOURCE = NIL
PLIST = NIL
%GENERIC-FUNCTION = NIL
QUALIFIERS = NIL
SPECIALIZERS = NIL
LAMBDA-LIST = (FOO)
%FUNCTION = #<FUNCTION (LAMBDA (FOO)) {227EBC6B}>
%DOCUMENTATION = NIL
SIMPLE-NEXT-METHOD-CALL = NIL
; No value
CL-USER>
This allowing SPECIALIZERS to be nil given the LAMBDA-LIST seems against
"The :specializers argument is a list of the specializer metaobjects for the method. An error is signaled if this value is not a proper list, or if the length of the list differs from the number of required arguments in the :lambda-list argument, or if any element of the list is not a specializer metaobject. If this value is not supplied, an error is signaled." at http://metamodular.com/CLOS-MOP/initialization-of-method-metaobjects.html
But I don't know enough about CLOS to remark further re SBCL behavior but maybe this is better:
CL-USER> (setf return (make-instance 'standard-method :function #'(lambda (foo) foo) :lambda-list '(foo)
:specializers (list (find-class 'standard-object))))
#<STANDARD-METHOD (#) {1003A03E53}>
CL-USER> (describe return)
#<STANDARD-METHOD (#) {100..
[standard-object]
Slots with :INSTANCE allocation:
SOURCE = NIL
PLIST = NIL
%GENERIC-FUNCTION = NIL
QUALIFIERS = NIL
SPECIALIZERS = (#)
LAMBDA-LIST = (FOO)
%FUNCTION = #<FUNCTION (LAMBDA (FOO)) {227EBC6B}>
%DOCUMENTATION = NIL
SIMPLE-NEXT-METHOD-CALL = NIL
; No value
CL-USER>
It makes CLISP happy viz.
[1]> (make-instance 'standard-method :function #'(lambda (foo) foo)
:lambda-list '(foo))
*** - (INITIALIZE-INSTANCE STANDARD-METHOD): Missing :SPECIALIZERS argument.
The following restarts are available:
ABORT :R1 Abort main loop
Break 1 [2]> :R1
[3]> (make-instance 'standard-method :function #'(lambda (foo) foo)
:lambda-list '(foo) :specializers (list (find-class 'standard-object)))
#<STANDARD-METHOD (#)>
[4]>
But still fails on Corman Lisp viz
(make-instance 'standard-method :lambda-list '(foo) :function #'(lambda (foo) foo) :specializers (list (find-class 'standard-object)))
;;; An error of type SIMPLE-ERROR was detected in function STD-SLOT-VALUE:
;;; Error: The slot COMMON-LISP::BODY is unbound in the object #<;;; An error of type SIMPLE-ERROR was detected in function STD-SLOT-VALUE:
;;; Error: The slot COMMON-LISP::EFFECTIVE-SLOTS is missing from the class #<Standard-Class BUILT-IN-CLASS #x614B3A0>.
;;; Entering Corman Lisp debug loop.
;;; Use :C followed by an option to exit. Type :HELP for help.
;;; Restart options:
;;; 1 Abort to top level.
But, I see on my macbook Clozure CL seems happy with nil for SPECIALIZERS and gives
? (setf return (make-instance 'standard-method :lambda-list '(foo)
:function #'(lambda (foo) foo)))
#
? (describe return)
#
Class: #
Wrapper: #<CCL::CLASS-WRAPPER STANDARD-METHOD #x302000017FAD>
Instance slots
CCL::QUALIFIERS: NIL
CCL::SPECIALIZERS: NIL
FUNCTION: #<Compiled-function # (Non-Global) #x302000D3341F>
GENERIC-FUNCTION: NIL
CCL::NAME: NIL
CCL::LAMBDA-LIST: (FOO)
?
from cormanlisp.
Thanks for reporting the problem! I might investigate it later, but it is low priority now.
from cormanlisp.
Related Issues (20)
- *print-case* :capitalize does not capitalize printed values HOT 3
- The Format function's F directive's k parameter fails when preceded only by a tilde and 2 commas HOT 2
- The Format function's $ directive only displays one 0 after the decimal when default is two HOT 3
- Do not change lineendings when editing files using Corman Lisp IDE
- Consider static linking of Visual C++ runtime to the executables HOT 24
- atan2 incorrect for some inputs HOT 3
- Using keyword symbols as slot-descriptors in DEFSTRUCT
- Missing file clos-tests.lisp HOT 4
- DLL compiled in "debug"? HOT 5
- sampledll causes an error when client.exe exits HOT 4
- Quicklisp HOT 4
- Implement conventional command line switches (-eval, -norc, etc) HOT 1
- load-image fails: push-module-directory undefined HOT 1
- retarget corman common lisp to GCC (GNU compiler collection) HOT 1
- Corman Lisp running on M1-based Mac (via Windows for ARM) HOT 4
- Is there a Windows binary I can download? I don't need the source code HOT 2
- Can we interface with C#? HOT 1
- Is this project still being worked on? HOT 2
- Cannot start; a window flickers then disappears
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 cormanlisp.