SBCL: asdf: load-system fails when defining a string constant

Using SBCL, I have a problem with my system being defined through ASDF not loading when the lisp code defines a line constant. Here is the code:

constants.lisp

(defconstant A 1.0)
(defconstant B "B")

simple.asd

(defsystem :simple
:components ((:file "constants")))

When downloading through

(asdf:load-system "simple")

I get the following error (the result is slightly reduced):

* (asdf:load-system "simple")  
; compiling file "/Users/.../constants.lisp"
; compiling (DEFCONSTANT A ...)
; compiling (DEFCONSTANT B ...)
; /Users/.../constants-TMP.fasl written
; compilation finished in 0:00:00.003

debugger invoked on a DEFCONSTANT-UNEQL in thread
#<THREAD "main thread" RUNNING {1002BFEA93}>:
   The constant B is being redefined (from "B" to "B")

The error does not occur with clisp, ccl and abcl. Also, uploading a file via

(load "constants.lisp")

works great.

I use

SBCL 1.2.14, ASDF 3.1.3, MacOS

Thanks for any tips.

Oliver

+4
source share
2 answers

Why doesn't string string work?

The specification defconstanttells us that:

undefined, defconstant.

: ?

: undefined, - , , defconstant eql .

eql.

SBCL , ( xxx-TMP.fasl), defconstant, , . ( - - , ), .

, , ( eq), . FASL SBCL, .

?

  • , alexandria:define-constant, , . :

    (defmacro defconst (symbol value)
     `(defconstant ,symbol 
        (or (and (boundp ',symbol) 
                 (symbol-value ',symbol))
            ,value)))
    

    defconstant - , , eql.

  • defvar , ( ).

+8

. .

0

Source: https://habr.com/ru/post/1624356/


All Articles