From: Sam S. <sd...@gn...> - 2017-08-01 13:58:44
|
Hi, I am writing in regards to the CLISP CLOS style warnings reported in https://sourceforge.net/p/clisp/mailman/message/35946823/ Specifically: --8<---------------cut here---------------start------------->8--- WARNING: Adding method #<STANDARD-METHOD (#<STANDARD-CLASS TEST-OP> (EQL #<SYSTEM "alexandria">))> to an already called generic function #<STANDARD-GENERIC-FUNCTION OPERATION-DONE-P> WARNING: Adding method #<STANDARD-METHOD (#<STANDARD-CLASS TEST-OP> (EQL #<SYSTEM "alexandria">))> to an already called generic function #<STANDARD-GENERIC-FUNCTION PERFORM> WARNING: Adding method #<STANDARD-METHOD (#<STANDARD-CLASS TEST-OP> (EQL #<SYSTEM "babel">))> to an already called generic function #<STANDARD-GENERIC-FUNCTION OPERATION-DONE-P> --8<---------------cut here---------------end--------------->8--- The rationale for these warnings is explained in http://clisp.org/impnotes/mop-clisp.html#mop-clisp-gf-already-called-warning However, when the normal use case for a generic function is being extended by its users (e.g., `print-object`), this warning is inappropriate. ASDF user macros, apparently, expand to method definitions, thus they are similar to `print-object`. To mark a generic function as user-extendable, one can now use a declaration: --8<---------------cut here---------------start------------->8--- (defgeneric perform (...) (declare #+clisp (dynamically-modifiable)) ...) (defgeneric operation-done-p (...) (declare #+clisp (dynamically-modifiable)) ...) --8<---------------cut here---------------end--------------->8--- The declaration is now in `hg tip` (but has not been released yet). Thank you! -- Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504 http://steingoldpsychology.com http://www.childpsy.net http://honestreporting.com http://jij.org https://jihadwatch.org http://mideasttruth.com Me, sarcastic?! Yeah, right... |
From: Sam S. <sd...@gn...> - 2017-08-01 15:08:48
|
> * Faré <snuerr@tznvy.pbz> [2017-08-01 10:07:33 -0400]: > >> To mark a generic function as user-extendable, one can now use a >> declaration: >> >> --8<---------------cut here---------------start------------->8--- >> (defgeneric perform (...) >> (declare #+clisp (dynamically-modifiable)) >> ...) >> (defgeneric operation-done-p (...) >> (declare #+clisp (dynamically-modifiable)) >> ...) >> --8<---------------cut here---------------end--------------->8--- >> >> The declaration is now in `hg tip` (but has not been released yet). >> > Will that declaration cause a warning or error on older versions of > clisp? If yes, what read-time conditional more precise than #+clisp > can I use to only enable on recent enough versions of clisp? My first reaction was --8<---------------cut here---------------start------------->8--- (declaim (declaration dynamically-modifiable)) --8<---------------cut here---------------end--------------->8--- but for some reason it does not work with defgeneric. Sorry. -- Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504 http://steingoldpsychology.com http://www.childpsy.net http://www.memritv.org https://jihadwatch.org http://camera.org http://jij.org Only a fool has no doubts. |
From: Pascal B. <pj...@in...> - 2017-08-01 15:21:22
|
> On 1 Aug 2017, at 17:08, Sam Steingold <sd...@gn...> wrote: > >> * Faré <snuerr@tznvy.pbz> [2017-08-01 10:07:33 -0400]: >> >>> To mark a generic function as user-extendable, one can now use a >>> declaration: >>> >>> --8<---------------cut here---------------start------------->8--- >>> (defgeneric perform (...) >>> (declare #+clisp (dynamically-modifiable)) >>> ...) >>> (defgeneric operation-done-p (...) >>> (declare #+clisp (dynamically-modifiable)) >>> ...) >>> --8<---------------cut here---------------end--------------->8--- >>> >>> The declaration is now in `hg tip` (but has not been released yet). >>> >> Will that declaration cause a warning or error on older versions of >> clisp? If yes, what read-time conditional more precise than #+clisp >> can I use to only enable on recent enough versions of clisp? > > My first reaction was > > --8<---------------cut here---------------start------------->8--- > (declaim (declaration dynamically-modifiable)) > --8<---------------cut here---------------end--------------->8--- > > but for some reason it does not work with defgeneric. > Sorry. 1- when naming an implementation-specific declaration, we need to know what package it comes from! (Now, an implementation could use only the symbol-name of the declaration so it would accept with the same semantics any package, but this would be a problem if the program uses the same symbol name in a different package to mean something else, so I would advise implementations to avoid using symbol-names for declarations, and instead to specify a specific package). 2- indeed the correct way to use implementation specific declarations is to declaim them. #-clisp (defpackage “EXT” #| be careful with those 💣🔪🔫 smart quotes! |# (:use) (:export “DYNAMICALLY-MODIFIABLE”)) (declaim (declaration ext:dynamically-modifiable)) (defgeneric foo (bar) (declare ext:dynamically-modifiable))) It works perfectly, but on clisp, since DYNAMICALLY-MODIFIABLE doesn’t come from EXT. Where does it come from??? [pjb@despina :0.0 ~]$ clall '(compile-file "/tmp/d.lisp")' Armed Bear Common Lisp: ======================================================================== Implementation: Armed Bear Common Lisp 1.4.0 on Mac OS X 10.12.6 on X86_64 NIL (despina.home) Reading of: "(compile-file \"/tmp/d.lisp\")" signaled no error Evaluation of: (COMPILE-FILE "/tmp/d.lisp") signaled the following error: #<READER-ERROR {2D87B142}> The symbol "DYNAMICALLY-MODIFIABLE" was not found in package EXT. wrote nothing on *ERROR-OUTPUT* wrote nothing on *TRACE-OUTPUT* wrote the following *STANDARD-OUTPUT* (lines excluded): ------------------------------------------------------------------------ ; Compiling /private/tmp/d.lisp ... ; (DEFPACKAGE "EXT" ...) ------------------------------------------------------------------------ returned no value Clozure Common Lisp: --> #P"/private/tmp/d.dx64fsl", NIL, NIL CLISP: ======================================================================== Implementation: CLISP 2.49 (2010-07-07) (built 3704439585) (memory 3704439775) on /usr/bin/clang -arch x86_64 -pipe -Wl,-no_pie -arch x86_64 -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -O -DUNIX_BINARY_DISTRIB -DENABLE_UNICODE -DDYNAMIC_MODULES -I. -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -lintl -Wl,-framework -Wl,CoreFoundation -lreadline -lncurses -liconv -L/opt/local/lib -lsigsegv libgnu_cl.a -L/opt/local/lib SAFETY=0 HEAPCODES STANDARD_HEAPCODES WIDE_HARD GENERATIONAL_GC SPVW_BLOCKS SPVW_MIXED TRIVIALMAP_MEMORY libsigsegv 2.11 libiconv 1.15 libreadline 7.0 GNU C 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42) on X86_64 X86_64 (despina.home [192.168.7.10]) Reading of: "(compile-file \"/tmp/d.lisp\")" signaled no error Evaluation of: (COMPILE-FILE "/tmp/d.lisp") signaled the following error: #<SYSTEM::SIMPLE-PACKAGE-ERROR #x000000020023FE91> READ from #<CLOSED INPUT BUFFERED FILE-STREAM CHARACTER #P"/tmp/d.lisp" @5>: #<PACKAGE EXT> has no external symbol with name "DYNAMICALLY-MODIFIABLE" wrote the following *ERROR-OUTPUT* (lines excluded): ------------------------------------------------------------------------ 0 errors, 0 warnings ------------------------------------------------------------------------ wrote nothing on *TRACE-OUTPUT* wrote the following *STANDARD-OUTPUT* (lines excluded): ------------------------------------------------------------------------ ;; Compiling file /tmp/d.lisp ... ------------------------------------------------------------------------ returned no value ECL: ======================================================================== Implementation: ECL 16.1.2 on Darwin 16.7.0 on x86_64 NIL (despina.home) Reading of: "(compile-file \"/tmp/d.lisp\")" signaled no error Evaluation of: (COMPILE-FILE "/tmp/d.lisp") signaled the following error: #<a C:COMPILER-NOTE> Note: Invoking external command: gcc -I. -I/usr/local/include/ -g -O2 -fPIC -fno-common -D_THREAD_SAFE -Ddarwin -O2 -c /private/tmp/d.c -o /private/tmp/d.o wrote nothing on *ERROR-OUTPUT* wrote nothing on *TRACE-OUTPUT* wrote the following *STANDARD-OUTPUT* (lines excluded): ------------------------------------------------------------------------ ;;; Loading #P"/usr/local/lib/ecl-16.1.2/cmp.fas" ;;; ;;; Compiling /tmp/d.lisp. ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0 ;;; ;;; Compiling (DEFGENERIC FOO ...). ;;; End of Pass 1. ------------------------------------------------------------------------ returned no value SBCL:; compiling file "/private/tmp/d.lisp" (written 01 AUG 2017 05:19:58 PM): ; compiling (DEFPACKAGE "EXT" ...) ; compiling (DECLAIM (DECLARATION EXT:DYNAMICALLY-MODIFIABLE)) ; compiling (DEFGENERIC FOO ...) ; /tmp/d.fasl written ; compilation finished in 0:00:00.003 --> #P"/private/tmp/d.fasl", T, T ======================================================================== [pjb@despina :0.0 ~]$ -- __Pascal J. Bourguignon__ |
From: Pascal B. <pj...@in...> - 2017-08-01 15:26:41
|
> On 1 Aug 2017, at 17:21, Pascal Bourguignon <pj...@in...> wrote: > > It works perfectly, but on clisp, since DYNAMICALLY-MODIFIABLE doesn’t come from EXT. > Where does it come from??? Oh, and but on abcl, which also has a EXT package. I would advise remaining those short-named packages, unless they implement a CDR-specified API. “ORG.CLISP.EXT” sounds a good unique name, or at least “CLISP-EXT”… > [pjb@despina :0.0 ~]$ clall '(compile-file "/tmp/d.lisp")' > > > > Armed Bear Common Lisp: > ======================================================================== > Implementation: Armed Bear Common Lisp 1.4.0 > on Mac OS X 10.12.6 > on X86_64 NIL (despina.home) > > Reading of: "(compile-file \"/tmp/d.lisp\")" > signaled no error > > Evaluation of: (COMPILE-FILE "/tmp/d.lisp") > signaled the following error: > #<READER-ERROR {2D87B142}> > The symbol "DYNAMICALLY-MODIFIABLE" was not found in package EXT. > wrote nothing on *ERROR-OUTPUT* > wrote nothing on *TRACE-OUTPUT* > wrote the following *STANDARD-OUTPUT* (lines excluded): > ------------------------------------------------------------------------ > ; Compiling /private/tmp/d.lisp ... > ; (DEFPACKAGE "EXT" ...) > ------------------------------------------------------------------------ > returned no value > -- __Pascal J. Bourguignon__ |
From: Sam S. <sd...@gn...> - 2017-08-01 17:13:14
|
> * Pascal Bourguignon <cwo@vasbezngvzntb.pbz> [2017-08-01 17:21:12 +0200]: > > It works perfectly, but on clisp, since DYNAMICALLY-MODIFIABLE doesn’t > come from EXT. > Where does it come from??? CLOS. -- Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504 http://steingoldpsychology.com http://www.childpsy.net http://jij.org http://islamexposedonline.com https://ffii.org http://iris.org.il A computer scientist is someone who fixes things that aren't broken. |