Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#633 generic function not available in DEFINE-METHOD-COMBINATION

open
Bruno Haible
clisp (525)
5
2012-03-21
2012-03-21
Greg Pfeil
No

The following code prints "this function: NIL" when I would expect something like "this function: #<STANDARD-GENERIC-FUNCTION ECHO>".

(define-method-combination print-gf ()
((primary () :required t))
(:generic-function gf)
`(progn (format t "this function: ~A" ,gf)
(call-method ,(first primary) ,(rest primary))))

(defgeneric echo (x)
(:method-combination print-gf)
(:method (x)
x))

(echo t)
=>
this function: NIL
T

my system: Darwin Tiamat.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
my clisp:

GNU CLISP 2.49+ (2010-07-17) (built 3538508120) (memory 3538508385)
Software: GNU C 4.2.1 (Apple Inc. build 5666) (dot 3)
gcc-4.2 -std=c99 -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -Wno-sign-compare -Wno-format-nonliteral -O -falign-functions=4 -pthread -DUNIX_BINARY_DISTRIB -DENABLE_UNICODE -DMULTITHREAD -DPOSIX_THREADS -DDYNAMIC_MODULES -DNO_GETTEXT libgnu.a -lncurses -liconv -L/usr/local/lib -lsigsegv -lc -R/usr/local/lib -L/usr/X11/lib -R/usr/X11/lib
SAFETY=0 HEAPCODES STANDARD_HEAPCODES WIDE_HARD GENERATIONAL_GC SPVW_BLOCKS SPVW_MIXED TRIVIALMAP_MEMORY
libsigsegv 2.10
libiconv 1.11
Features:
(REGEXP WILDCARD SYSCALLS I18N LOOP COMPILER CLOS MOP CLISP ANSI-CL COMMON-LISP
LISP=CL INTERPRETER LOGICAL-PATHNAMES MT SOCKETS GENERIC-STREAMS SCREEN
UNICODE BASE-CHAR=CHARACTER WORD-SIZE=64 UNIX MACOS)
C Modules: (clisp i18n syscalls regexp)
Installation directory: /Users/greg/Documents/sources/clisp/src/
User language: ENGLISH
Machine: X86_64 (X86_64) tiamat.local [10.0.1.103]

Discussion