[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

need help debugging asdf:load-system

Jim Newton

2/25/2016 10:18:00 AM

I hope someone can give me some clues about what to try to debug this problem.

I'm using load-system in slime to load an asdf system.
It prints lots of stuff and finally ends with the following message in the slime repl buffer.
The message reports 2 fatal errors, but when I use the slime menu item
SLIME->Compilation->List Notes
I only see one error.


; compiling (DEFINE-TEST TEST/GATHER-TYPE-DECLARATIONS ...)
; compiling (DEFINE-TEST TEST/DESTRUCTURING-METHODS ...)

; /Users/jnewton/.cache/common-lisp/sbcl-1.3.0-macosx-x64/Users/jnewton/sw/regular-type-expression/rte/test-destructuring-case-tmpD801X3GJ.fasl written
; compilation finished in 0:00:05.446
;
; compilation unit aborted
; caught 2 fatal ERROR conditions
; caught 167 WARNING conditions
; caught 5 STYLE-WARNING conditions
; printed 70 notes

CL-USER>



In my code there are some calls to warn which raise a condition which is a subtype of warning, (not a subtype of error)
If I comment out those calls to WARN, the 2 fatal errors seem to go away.

I will continue to investigate, but perhaps someone can give me a hint who has seen something
similar before...
4 Answers

Jim Newton

2/25/2016 10:37:00 AM

0

BTW the error when I view it in SLIME->Compilation->List Notes is, the following which just
seems to indicate "something" when wrong while compiling. But it is not clear, what.

[+] warning (178)
[+] redefinition (410)
-+ error (1)
`-- COMPILE-FILE-ERROR while
compiling #<CL-SOURCE-FILE "rte-test" "rte" "test-destructuring-case">
[+] note (70)
[+] style-warning (5)

Jim Newton

2/25/2016 1:33:00 PM

0

It looks like ?asdf? gives up compiling the following code, but doesn't really explain why.

;;---- start ---------
(in-package :rte.test)

(defun debug-123 ()
(TYPEP '(1 2 :X 3 :Y 4)
'(RTE
(:and KEYWORD (EQL :X)))))
;; ---- end ------------


The definition of the rte type is the following.
And I have verified that define-rte successfully returns
(AND SEQUENCE
(SATISFIES REGULAR-TYPE-EXPRESSION::|" "((:AND KEYWORD (EQL :X)))|))

But in doing so signals a condition which is a subclass of warning.

(deftype rte (&rest pattern)
(or (gethash pattern *rte-types* nil)
(define-rte pattern)))

Jim Newton

2/25/2016 1:51:00 PM

0

I think I am getting close to pinpointing the issue. Could be an issue with sbcl, or maybe with slime.
Or maybe it is correct behavior of type expansion.

Here is the code. When I compile the top level forms one by one in slime,
the last one reports compilation failed, and issues the text of the warning in RED.
Is this correct behavior?

(in-package :cl-user)

(define-condition debug-121 (warning)
((sub :type (or symbol nil cons) :initarg :sub :initform :UNINITIALIZED)
(super :type (or symbol nil cons) :initarg :super :initform :UNINITIALIZED))
(:report (lambda (condition stream)
(format stream "some random warning message ~S is a subtype of ~S"
(slot-value condition 'sub)
(slot-value condition 'super)))))

(defun expand-rte2 (pattern)
(declare (ignore pattern))
(warn 'debug-121 :sub :x :super :y)
'(AND SEQUENCE (SATISFIES length)))

(deftype debug-122 (&rest pattern)
(expand-rte2 pattern))

(defun debug-123 ()
(TYPEP '(1 2 :X 3 :Y 4)
'(debug-122
(:and KEYWORD (EQL :X)))))

Jim Newton

2/25/2016 2:01:00 PM

0

Maybe this is an issue with slime?

I've wrapped the expressions with (eval-when (:compile-toplevel :load-toplevel :execute) ...)
forms, and verified that I can indeed, compile the file with (compile-file...) and thereafter I can load the .fasl file.

However, when I use C-c C-c in slime, it reports that compilation failed.

strange.


(in-package :cl-user)

(eval-when (:compile-toplevel :load-toplevel :execute)
(define-condition debug-121 (warning)
((sub :type (or symbol nil cons) :initarg :sub :initform :UNINITIALIZED)
(super :type (or symbol nil cons) :initarg :super :initform :UNINITIALIZED))
(:report (lambda (condition stream)
(format stream "some random warning message ~S is a subtype of ~S"
(slot-value condition 'sub)
(slot-value condition 'super))))))

(eval-when (:compile-toplevel :load-toplevel :execute)
(defun expand-rte2 (pattern)
(declare (ignore pattern))
(warn 'debug-121 :sub :x :super :y)
'(AND SEQUENCE (SATISFIES length))))

(eval-when (:compile-toplevel :load-toplevel :execute)
(deftype debug-122 (&rest pattern)
(expand-rte2 pattern)))

(defun debug-123 ()
(TYPEP '(1 2 :X 3 :Y 4)
'(debug-122
(:and KEYWORD (EQL :X)))))