#238: Bad error when reading #S(...) for a partially defined structure -----------------------+---------------------------------------------------- Reporter: sboukarev | Owner: ehuelsmann Type: defect | Status: new Priority: minor | Milestone: Component: compiler | Version: Keywords: | -----------------------+---------------------------------------------------- {{{ (defstruct struct a)
(defvar *t* #S(struct :a 1)) }}}
Running compile-file on it results in "The assertion NIL failed."
At compile-time defstruct lets the compiler know that the structure exists, but the constructor and predicate functions are not defined until load time. #S tries to call a stump version of one of these functions. After exiting the debugger calling either (make-struct) or (struct-p) results in the same assertion failure
#238: Bad error when reading #S(...) for a partially defined structure -----------------------+---------------------------------------------------- Reporter: sboukarev | Owner: ehuelsmann Type: defect | Status: new Priority: minor | Milestone: 1.2.0 Component: compiler | Version: Keywords: | -----------------------+---------------------------------------------------- Changes (by ehuelsmann):
* milestone: => 1.2.0
Comment:
While the spec says "The #S reader macro might or might not recognize the newly defined structure type name at compile time.", this is not an ansi failure.
However, I concur that the error is far from helpful in finding the actual problem. Let's focus on that here first. We could (later) see if we want to make the constructor available for the reader (I see value in that as well).
#238: Bad error when reading #S(...) for a partially defined structure -----------------------+---------------------------------------------------- Reporter: sboukarev | Owner: ehuelsmann Type: defect | Status: new Priority: minor | Milestone: 1.2.0 Component: compiler | Version: Keywords: | -----------------------+----------------------------------------------------
Comment(by sboukarev):
That's what I meant, I don't expect this to work, but concerned about the error itself. And this doesn't work in other implementations as well.
armedbear-ticket@common-lisp.net