[Openmcl-devel] Error: The function PRINT is defined as something other than a generic function

Jason E. Aten j.e.aten at gmail.com
Fri Apr 1 23:48:09 PDT 2011


I'm trying to define a print method for my class, and I'm getting "Error:
The function PRINT is defined as something other than a generic function."

Below shows the two commands that when issues, reproduce this on Linux
x86_64.  What should I try instead?

Apologies if this is obvious. I'm new to CLOS, and these classes are auto-
generated by SWIG as wrappers for C++ classes.

Jason

jaten at afarm:~/dj/ldc2swig$ ccl -n
Welcome to Clozure Common Lisp Version 1.7-dev-r14684M-trunk  (LinuxX8664)!
? (cl:defclass object()
  ((ff-pointer :reader ff-pointer)))

#<STANDARD-CLASS OBJECT>
? (cl:defmethod print ((self object))
  (Object_dprint (ff-pointer self)))

;Compiler warnings
:

;   In (PRINT (OBJECT)) inside an anonymous lambda form: Undefined function
OBJECT_DPRINT


> Error: The function PRINT is defined as something other than a generic
function.


> While executing: ENSURE-GENERIC-FUNCTION, in process listener(1).
> Type :GO to continue, :POP to abort, :R for a list of available restarts.
> If continued: Try to remove any global non-generic function or macro
definition.
> Type :? for other options.


1 > :b
 (7FB61B6E6A10) : 0 (ENSURE-GENERIC-FUNCTION PRINT) 341
 (7FB61B6E6A40) : 1 (ENSURE-METHOD PRINT (#<STANDARD-CLASS OBJECT>)
:FUNCTION #<Compiled Method-function (PRINT #) (Non-Global)  #x30200056D4BF>
:QUALIFIERS NIL :LAMBDA-LIST (S\
ELF)) 285
 (7FB61B6E6AA8) : 2 (FUNCALL #'#<Anonymous Function #x3020005682BF>) 157
 (7FB61B6E6AB8) : 3 (TOPLEVEL-EVAL (DEFMETHOD PRINT (#) (OBJECT_DPRINT #))
NIL) 709
 (7FB61B6E6B60) : 4 (READ-LOOP :INPUT-STREAM #<SYNONYM-STREAM to
*TERMINAL-IO* #x30200055A9ED> :OUTPUT-STREAM #<SYNONYM-STREAM to
*TERMINAL-IO* #x30200055A63D> :BREAK-LEVEL 0 :\
PROMPT-FUNCTION #<Compiled-function (:INTERNAL CCL::READ-LOOP) (Non-Global)
#x30000059B38F>) 2317
 (7FB61B6E6DC0) : 5 (TOPLEVEL-LOOP) 109
 (7FB61B6E6DF0) : 6 (FUNCALL #'#<(:INTERNAL (TOPLEVEL-FUNCTION
(CCL::LISP-DEVELOPMENT-SYSTEM T)))>) 117
 (7FB61B6E6E10) : 7 (FUNCALL #'#<(:INTERNAL
CCL::MAKE-MCL-LISTENER-PROCESS)>) 741
 (7FB61B6E6EB0) : 8 (RUN-PROCESS-INITIAL-FORM #<TTY-LISTENER listener(1)
[Active] #x30200055776D> (#<COMPILED-LEXICAL-CLOSURE # #x302000556E8F>)) 717
 (7FB61B6E6F48) : 9 (FUNCALL #'#<(:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL
(PROCESS)))> #<TTY-LISTENER listener(1) [Active] #x30200055776D>
(#<COMPILED-LEXICAL-CLOSURE # #x3020\
00556E8F>)) 389
 (7FB61B6E6F98) : 10 (FUNCALL #'#<(:INTERNAL
CCL::THREAD-MAKE-STARTUP-FUNCTION)>) 301
1 >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20110402/f8fd7545/attachment.htm>


More information about the Openmcl-devel mailing list