Hello,
I ran into a situation where I think ECL 16.1.3 has a bug in it:
Linux violet > ecl ;;; Loading "/home/psilord/quicklisp/setup.lisp" ;;; Loading #P"/usr/local/lib/ecl-16.1.3/asdf.fas" ECL (Embeddable Common-Lisp) 16.1.3 (git:UNKNOWN) Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll Copyright (C) 2016 Daniel Kochmanski ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level in: #<process TOP-LEVEL>.
(defstruct (foo (:type vector) (:predicate nil)) qux bar)
Condition of type: SIMPLE-ERROR NIL is an illegal structure predicate.
Available restarts:
1. (RESTART-TOPLEVEL) Go back to Top-Level REPL.
Broken at SI:BYTECODES. [Evaluation of: (SI:TOP-LEVEL T)] In: #<process TOP-LEVEL>.
The clhs spec says:
http://www.lispworks.com/documentation/lw70/CLHS/Body/m_defstr.htm
most notably:
":predicate
This option takes one argument, which specifies the name of the type predicate. If the argument is not supplied or if the option itself is not supplied, the name of the predicate is made by concatenating the name of the structure to the string "-P", interning the name in whatever package is current at the time defstruct is expanded. If the argument is provided and is nil, no predicate is defined. A predicate can be defined only if the structure is named; if :type is supplied and :named is not supplied, then :predicate must either be unsupplied or have the value nil. "
In this case, :type is supplied, :named is not supplied, and therefore :predicate must either be unsupplied or have the value NIL. In my case, it has the value NIL.
It appears to me that I have written legal CL, but ECL doesn't think so.
Thank you!
-pete
Interestingly I cannot reproduce it. I'm running Linux Mint 18.2 and built ECL from a git checkout of the tag ECL-16.1.3:
$ /opt/ecl/bin/ecl ;;; Loading "/home/spacebat/quicklisp/setup.lisp" ;;; Loading #P"/opt/ecl/lib/ecl-16.1.3/asdf.fas" ECL (Embeddable Common-Lisp) 16.1.3 (git:17645d703eb95b9452186015f5f3a1a9c0bc6b6a) Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll Copyright (C) 2016 Daniel Kochmanski ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level in: #<process TOP-LEVEL>.
(defstruct (foo (:type vector) (:predicate nil)) qux bar)
FOO
(make-foo :qux "q" :bar "b")
#("q" "b")
However if I install ECL via apt, I get an older version with this banner:
ECL (Embeddable Common-Lisp) 15.3.7 (git:UNKNOWN)
The error you describe is then evident.
On 8 May 2018 at 17:13, Peter Keller psilord@cs.wisc.edu wrote:
Hello,
I ran into a situation where I think ECL 16.1.3 has a bug in it:
Linux violet > ecl ;;; Loading "/home/psilord/quicklisp/setup.lisp" ;;; Loading #P"/usr/local/lib/ecl-16.1.3/asdf.fas" ECL (Embeddable Common-Lisp) 16.1.3 (git:UNKNOWN) Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll Copyright (C) 2016 Daniel Kochmanski ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level in: #<process TOP-LEVEL>.
(defstruct (foo (:type vector) (:predicate nil)) qux bar)
Condition of type: SIMPLE-ERROR NIL is an illegal structure predicate.
Available restarts:
- (RESTART-TOPLEVEL) Go back to Top-Level REPL.
Broken at SI:BYTECODES. [Evaluation of: (SI:TOP-LEVEL T)] In: #<process TOP-LEVEL>.
The clhs spec says:
http://www.lispworks.com/documentation/lw70/CLHS/Body/m_defstr.htm
most notably:
":predicate
This option takes one argument, which specifies the name of the type
predicate. If the argument is not supplied or if the option itself is not supplied, the name of the predicate is made by concatenating the name of the structure to the string "-P", interning the name in whatever package is current at the time defstruct is expanded. If the argument is provided and is nil, no predicate is defined. A predicate can be defined only if the structure is named; if :type is supplied and :named is not supplied, then :predicate must either be unsupplied or have the value nil. "
In this case, :type is supplied, :named is not supplied, and therefore :predicate must either be unsupplied or have the value NIL. In my case, it has the value NIL.
It appears to me that I have written legal CL, but ECL doesn't think so.
Thank you!
-pete
On 05/08/2018 11:03 PM, Andrew Kirkpatrick wrote:
Interestingly I cannot reproduce it. I'm running Linux Mint 18.2 and built ECL from a git checkout of the tag ECL-16.1.3:
$ /opt/ecl/bin/ecl ;;; Loading "/home/spacebat/quicklisp/setup.lisp" ;;; Loading #P"/opt/ecl/lib/ecl-16.1.3/asdf.fas" ECL (Embeddable Common-Lisp) 16.1.3 (git:17645d703eb95b9452186015f5f3a1a9c0bc6b6a) Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll Copyright (C) 2016 Daniel Kochmanski ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level in: #<process TOP-LEVEL>.
(defstruct (foo (:type vector) (:predicate nil)) qux bar)
FOO
(make-foo :qux "q" :bar "b")
#("q" "b")
However if I install ECL via apt, I get an older version with this banner:
ECL (Embeddable Common-Lisp) 15.3.7 (git:UNKNOWN)
The error you describe is then evident.
I suspect the tagged version and the actual release are different, but it seems it is moot.
I was not the only person to discover this bug:
https://gitlab.com/embeddable-common-lisp/ecl/issues/385
It turns out it is fixed on the head of ecl (and maybe by the time that tag was actually made, too).
When I switched to the head of ECL, the described problem went away.
Sadly, another problem showed up, this time trying to load fare-utils from the most recent edition of Quicklisp.
Linux violet > ecl ;;; Loading "/home/psilord/quicklisp/setup.lisp" ;;; Loading #P"/usr/local/lib/ecl-16.1.3/asdf.fas" ECL (Embeddable Common-Lisp) 16.1.3 (git:e3b9919ffaddbeb8d5f16c394fb70b813c5f0d94) Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll Copyright (C) 2016 Daniel Kochmanski ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level in: #<process TOP-LEVEL 0x2314f80>.
(ql:quickload :fare-utils)
To load "fare-utils": Load 1 ASDF system: fare-utils ; Loading "fare-utils" ;;; ;;; Compiling /home/psilord/quicklisp/dists/quicklisp/software/fare-utils-20170124-git/base/utils.lisp. ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0 ;;; . ;;; Error: ;;; in file utils.lisp, position 4443 ;;; at (EXPORTING-DEFINITIONS (DEFMACRO DEFINE-EXPORTER ...) ...) ;;; * The macro form (EXPORTING-DEFINITIONS (DEFMACRO DEFINE-EXPORTER (EXPORTER DEFINER) `(DEFMACRO ,EXPORTER (SYMBOL &REST ARGS) `(PROGN (,',DEFINER ,SYMBOL ,@ARGS) (ENSURE-SYMBOL-EXPORTED ,SYMBOL)))) (DEFINE-EXPORTER DEFINE*-EXPORTER DEFINE-EXPORTER) (DEFINE-EXPORTER DEF*CLASS DEFCLASS) (DEFINE-EXPORTER DEF*CONSTANT DEFCONSTANT) (DEFINE-EXPORTER DEF*GENERIC DEFGENERIC) (DEFINE-EXPORTER DEFINE*-COMPILER-MACRO DEFINE-COMPILER-MACRO) (DEFINE-EXPORTER DEFINE*-CONDITION DEFINE-CONDITION) (DEFINE-EXPORTER DEFINE*-METHOD-COMBINATION DEFINE-METHOD-COMBINATION) (DEFINE-EXPORTER DEFINE*-MODIFY-MACRO DEFINE-MODIFY-MACRO) (DEFINE-EXPORTER DEFINE*-SETF-EXPANDER DEFINE-SETF-EXPANDER) (DEFINE-EXPORTER DEFINE*-SYMBOL-MACRO DEFINE-SYMBOL-MACRO) (DEFINE-EXPORTER DEF*MACRO DEFMACRO) (DEFINE-EXPORTER DEF*METHOD DEFMETHOD) (DEFINE-EXPORTER DEF*PACKAGE DEFPACKAGE) (DEFINE-EXPORTER DEF*PARAMETER DEFPARAMETER) (DEFINE-EXPORTER DEF*SETF DEFSETF) (DEFINE-EXPORTER DEF*STRUCT DEFSTRUCT) (DEFINE-EXPORTER DEF*TYPE DEFTYPE) (DEFINE-EXPORTER DEF*FUN DEFUN) (DEFINE-EXPORTER DEF*VAR DEFVAR)) was not expanded successfully. ;;; Error detected: ;;; GO: The tagbody 2875 is missing. Condition of type: COMPILE-FILE-ERROR COMPILE-FILE-ERROR while compiling #<cl-source-file "fare-utils" "base" "utils">
Available restarts:
1. (RETRY) Retry compiling #<cl-source-file "fare-utils" "base" "utils">. 2. (ACCEPT) Continue, treating compiling #<cl-source-file "fare-utils" "base" "utils"> as having been successful. 3. (RETRY) Retry ASDF operation. 4. (CLEAR-CONFIGURATION-AND-RETRY) Retry ASDF operation after resetting the configuration. 5. (ABORT) Give up on "fare-utils" 6. (RESTART-TOPLEVEL) Go back to Top-Level REPL.
Broken at SI:BYTECODES. [Evaluation of: (QUICKLISP-CLIENT:QUICKLOAD :FARE-UTILS)] In: #<process TOP-LEVEL 0x2314f80>.
I appreciate you had spent some time looking into the :predicate bug.
Thank you!
-pete
Hey,
thank you for the report. This issue has been fixed around a year ago: b6a4d4a85148dfc0561981e7e65fcf2224ddb2a2 (reported here: https://gitlab.com/embeddable-common-lisp/ecl/issues/385). This change is not part of the release yet (fix was applied in 2017-05-30 while 16.1.3 was released in 2016-12-19).
If you are interested what we want to solve before we release 16.2.0 you may check out the milestone in here: https://gitlab.com/embeddable-common-lisp/ecl/issues?milestone_title=ECL+16....
Best regards, Daniel
(defstruct (foo (:type vector) (:predicate nil)) qux bar)
In both cases (ECL built from the tag and your install from the HEAD) make sure you remove previous ECL and its cache with FASLs. It might be that you use wrong library in your system (i.e two libecl libraries are installed, or FASL from incompatible version is loaded).
Regards, Daniel
On 09.05.2018 07:09, Peter Keller wrote:
On 05/08/2018 11:03 PM, Andrew Kirkpatrick wrote:
Interestingly I cannot reproduce it. I'm running Linux Mint 18.2 and built ECL from a git checkout of the tag ECL-16.1.3:
$ /opt/ecl/bin/ecl ;;; Loading "/home/spacebat/quicklisp/setup.lisp" ;;; Loading #P"/opt/ecl/lib/ecl-16.1.3/asdf.fas" ECL (Embeddable Common-Lisp) 16.1.3 (git:17645d703eb95b9452186015f5f3a1a9c0bc6b6a) Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll Copyright (C) 2016 Daniel Kochmanski ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level in: #<process TOP-LEVEL>.
(defstruct (foo (:type vector) (:predicate nil)) qux bar)
FOO
(make-foo :qux "q" :bar "b")
#("q" "b")
However if I install ECL via apt, I get an older version with this banner:
ECL (Embeddable Common-Lisp) 15.3.7 (git:UNKNOWN)
The error you describe is then evident.
I suspect the tagged version and the actual release are different, but it seems it is moot.
I was not the only person to discover this bug:
https://gitlab.com/embeddable-common-lisp/ecl/issues/385
It turns out it is fixed on the head of ecl (and maybe by the time that tag was actually made, too).
When I switched to the head of ECL, the described problem went away.
Sadly, another problem showed up, this time trying to load fare-utils from the most recent edition of Quicklisp.
Linux violet > ecl ;;; Loading "/home/psilord/quicklisp/setup.lisp" ;;; Loading #P"/usr/local/lib/ecl-16.1.3/asdf.fas" ECL (Embeddable Common-Lisp) 16.1.3 (git:e3b9919ffaddbeb8d5f16c394fb70b813c5f0d94) Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll Copyright (C) 2016 Daniel Kochmanski ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level in: #<process TOP-LEVEL 0x2314f80>.
(ql:quickload :fare-utils)
To load "fare-utils": Load 1 ASDF system: fare-utils ; Loading "fare-utils" ;;; ;;; Compiling /home/psilord/quicklisp/dists/quicklisp/software/fare-utils-20170124-git/base/utils.lisp. ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0 ;;; . ;;; Error: ;;; in file utils.lisp, position 4443 ;;; at (EXPORTING-DEFINITIONS (DEFMACRO DEFINE-EXPORTER ...) ...) ;;; * The macro form (EXPORTING-DEFINITIONS (DEFMACRO DEFINE-EXPORTER (EXPORTER DEFINER) `(DEFMACRO ,EXPORTER (SYMBOL &REST ARGS) `(PROGN (,',DEFINER ,SYMBOL ,@ARGS) (ENSURE-SYMBOL-EXPORTED ,SYMBOL)))) (DEFINE-EXPORTER DEFINE*-EXPORTER DEFINE-EXPORTER) (DEFINE-EXPORTER DEF*CLASS DEFCLASS) (DEFINE-EXPORTER DEF*CONSTANT DEFCONSTANT) (DEFINE-EXPORTER DEF*GENERIC DEFGENERIC) (DEFINE-EXPORTER DEFINE*-COMPILER-MACRO DEFINE-COMPILER-MACRO) (DEFINE-EXPORTER DEFINE*-CONDITION DEFINE-CONDITION) (DEFINE-EXPORTER DEFINE*-METHOD-COMBINATION DEFINE-METHOD-COMBINATION) (DEFINE-EXPORTER DEFINE*-MODIFY-MACRO DEFINE-MODIFY-MACRO) (DEFINE-EXPORTER DEFINE*-SETF-EXPANDER DEFINE-SETF-EXPANDER) (DEFINE-EXPORTER DEFINE*-SYMBOL-MACRO DEFINE-SYMBOL-MACRO) (DEFINE-EXPORTER DEF*MACRO DEFMACRO) (DEFINE-EXPORTER DEF*METHOD DEFMETHOD) (DEFINE-EXPORTER DEF*PACKAGE DEFPACKAGE) (DEFINE-EXPORTER DEF*PARAMETER DEFPARAMETER) (DEFINE-EXPORTER DEF*SETF DEFSETF) (DEFINE-EXPORTER DEF*STRUCT DEFSTRUCT) (DEFINE-EXPORTER DEF*TYPE DEFTYPE) (DEFINE-EXPORTER DEF*FUN DEFUN) (DEFINE-EXPORTER DEF*VAR DEFVAR)) was not expanded successfully. ;;; Error detected: ;;; GO: The tagbody 2875 is missing. Condition of type: COMPILE-FILE-ERROR COMPILE-FILE-ERROR while compiling #<cl-source-file "fare-utils" "base" "utils">
Available restarts:
- (RETRY) Retry compiling #<cl-source-file "fare-utils" "base" "utils">.
- (ACCEPT) Continue, treating compiling #<cl-source-file "fare-utils" "base"
"utils"> as having been successful. 3. (RETRY) Retry ASDF operation. 4. (CLEAR-CONFIGURATION-AND-RETRY) Retry ASDF operation after resetting the configuration. 5. (ABORT) Give up on "fare-utils" 6. (RESTART-TOPLEVEL) Go back to Top-Level REPL.
Broken at SI:BYTECODES. [Evaluation of: (QUICKLISP-CLIENT:QUICKLOAD :FARE-UTILS)] In: #<process TOP-LEVEL 0x2314f80>.
I appreciate you had spent some time looking into the :predicate bug.
Thank you!
-pete