Skip to content

Commit 3555a00

Browse files
committed
Remove static-vectors
1 parent 0df344d commit 3555a00

File tree

6 files changed

+111
-110
lines changed

6 files changed

+111
-110
lines changed

common-lisp-jupyter.asd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"pzmq"
2222
"puri"
2323
"shasht"
24-
(:feature (:or :abcl :allegro :ccl :clasp :cmu :ecl :lispworks :sbcl) "static-vectors")
24+
#+(or)(:feature (:or :abcl :allegro :ccl :clasp :cmu :ecl :lispworks :sbcl) "static-vectors")
2525
"trivial-do"
26-
"trivial-garbage"
26+
#+(or)"trivial-garbage"
2727
"trivial-mimes"
2828
"trivial-features")
2929
:components

src/heartbeat.lisp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
(with-slots (socket thread) hb
1616
(setf thread
1717
(bordeaux-threads:make-thread
18-
(lambda ()
19-
(inform :info hb "Starting thread")
20-
#-cmucl (pzmq:proxy socket socket (cffi:null-pointer))
21-
#+cmucl
22-
(pzmq:with-poll-items items ((socket :pollin))
23-
(prog ()
24-
poll
25-
(unless (zerop (pzmq:poll items +zmq-poll-timeout+))
26-
(send-heartbeat hb (recv-heartbeat hb)))
27-
(bordeaux-threads:thread-yield)
28-
(go poll))))
29-
:name "Jupyter Heartbeat"))))
18+
(lambda ()
19+
(with-debugger (:control t)
20+
(inform :info hb "Starting thread")
21+
#-cmucl (pzmq:proxy socket socket (cffi:null-pointer))
22+
#+cmucl
23+
(pzmq:with-poll-items items ((socket :pollin))
24+
(prog ()
25+
poll
26+
(unless (zerop (pzmq:poll items +zmq-poll-timeout+))
27+
(send-heartbeat hb (recv-heartbeat hb)))
28+
(bordeaux-threads:thread-yield)
29+
(go poll)))))
30+
:name "Jupyter Heartbeat"))))

src/kernel.lisp

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -672,96 +672,6 @@
672672
(values))))
673673

674674

675-
(defun control-debugger-hook (condition me-or-my-encapsulation)
676-
(declare (ignore me-or-my-encapsulation))
677-
(cond ((typep condition 'warning)
678-
(inform :warning "[~S] ~A~%" (type-of condition) condition)
679-
(muffle-warning))
680-
(t
681-
(inform :error "[~S] ~A~%" (type-of condition) condition)
682-
(abort))))
683-
684-
(defun shell-debugger-hook (condition me-or-my-encapsulation)
685-
(declare (ignore me-or-my-encapsulation))
686-
(cond ((typep condition 'warning)
687-
(format *standard-output* "[~S] ~A~%" (type-of condition) condition)
688-
(finish-output *standard-output*)
689-
(muffle-warning))
690-
(t
691-
(let ((env (dissect:capture-environment condition)))
692-
(format *error-output* "[~S] ~A~%" (type-of condition) condition)
693-
(finish-output *error-output*)
694-
(throw 'debug-error
695-
(make-eval-error condition (format nil "~A" condition)
696-
(mapcar (lambda (frame)
697-
(dissect:present frame nil))
698-
(dissect:environment-stack env))))))))
699-
700-
(defun debugger-type ()
701-
(cond ((or (not *enable-debugger*)
702-
#+clasp (core:debugger-disabled-p)
703-
#+sbcl (eq sb-ext:*invoke-debugger-hook* 'sb-debug::debugger-disabled-hook))
704-
:none)
705-
#+abcl
706-
(sys::*invoke-debugger-hook* :external)
707-
#+allegro
708-
(excl::*break-hook* :external)
709-
#+ccl
710-
(ccl:*break-hook* :external)
711-
#+clisp
712-
(sys::*break-driver* :external)
713-
#+clasp
714-
(ext:*invoke-debugger-hook* :external)
715-
#+ecl
716-
(ext:*invoke-debugger-hook* :external)
717-
#+lispworks
718-
(dbg::*debugger-wrapper-list* :external)
719-
#+mezzano
720-
(mezzano.debug:*global-debugger* :external)
721-
#+sbcl
722-
(sb-ext:*invoke-debugger-hook* :external)
723-
(*enable-internal-debugger* :internal)
724-
(t :none)))
725-
726-
(defmacro with-debugger ((&key control internal) &body body)
727-
(let ((debugger-hook (if control
728-
'control-debugger-hook
729-
'shell-debugger-hook)))
730-
`(flet ((body-func ()
731-
(catch 'debug-error
732-
(with-simple-restart
733-
(abort "Exit debugger, returning to top level.")
734-
,@body))))
735-
(case (debugger-type)
736-
(:external
737-
(body-func))
738-
,@(when internal
739-
#+clasp
740-
`((:internal
741-
(catch sys::*quit-tag*
742-
(body-func))))
743-
#-clasp
744-
`((:internal
745-
(body-func))))
746-
(otherwise
747-
(let ((*debugger-hook* ',debugger-hook)
748-
#+sbcl (sb-ext:*invoke-debugger-hook* ',debugger-hook)
749-
#+ccl (ccl:*break-hook* ',debugger-hook)
750-
#+ecl (ext:*invoke-debugger-hook* ',debugger-hook)
751-
#+clasp (ext:*invoke-debugger-hook* ',debugger-hook)
752-
#+abcl (sys::*invoke-debugger-hook* ',debugger-hook)
753-
#+clisp (sys::*break-driver* (lambda (continuable &optional condition print)
754-
(declare (ignore continuable print))
755-
(,debugger-hook condition nil)))
756-
#+allegro (excl::*break-hook* (lambda (&rest args)
757-
(,debugger-hook (fifth args))))
758-
#+lispworks (dbg::*debugger-wrapper-list* (lambda (function condition)
759-
(declare (ignore function))
760-
(,debugger-hook condition nil)))
761-
#+mezzano (mezzano.debug:*global-debugger* (lambda (condition)
762-
(,debugger-hook condition nil))))
763-
(body-func)))))))
764-
765675
(defun debug-enter-loop ()
766676
"Re-enter the debug loop after a restart which implements a debugger command."
767677
(throw 'enter-loop t))

src/message.lisp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
(:documentation "Representation of IPython messages"))
4444

4545

46-
#+(or abcl allegro ccl clasp cmu ecl lispworks sbcl)
46+
#+(or); abcl allegro ccl clasp cmu ecl lispworks sbcl)
4747
(defmethod initialize-instance :after ((instance message) &rest initargs &key &allow-other-keys)
4848
(declare (ignore initargs))
4949
(let ((buffers (message-buffers instance)))
@@ -149,7 +149,7 @@
149149
; explicitly defined element type is needed for CLISP
150150
:element-type '(unsigned-byte 8)))
151151

152-
#+(or abcl allegro ccl clasp cmu ecl lispworks sbcl)
152+
#+(or); abcl allegro ccl clasp cmu ecl lispworks sbcl)
153153
(defun read-buffer-part (ch msg)
154154
(pzmq:msg-recv msg (channel-socket ch))
155155
(let* ((size (pzmq:msg-size msg))
@@ -204,8 +204,8 @@
204204
(unless (more-parts ch msg)
205205
(return (nreverse parts)))
206206
(push
207-
#-(or abcl allegro ccl clasp cmu ecl lispworks sbcl) (read-binary-part ch msg)
208-
#+(or abcl allegro ccl clasp cmu ecl lispworks sbcl) (read-buffer-part ch msg)
207+
#-(or)#| abcl allegro ccl clasp cmu ecl lispworks sbcl)|# (read-binary-part ch msg)
208+
#+(or)#| abcl allegro ccl clasp cmu ecl lispworks sbcl)|# (read-buffer-part ch msg)
209209
parts)
210210
(go next)))))))
211211

src/utils.lisp

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,93 @@
189189
(defmethod close ((stream closed-input-stream) &key abort)
190190
(declare (ignore abort))
191191
nil)
192+
193+
(defun control-debugger-hook (condition me-or-my-encapsulation)
194+
(declare (ignore me-or-my-encapsulation))
195+
(cond ((typep condition 'warning)
196+
(inform :warning "[~S] ~A~%" (type-of condition) condition)
197+
(muffle-warning))
198+
(t
199+
(inform :error "[~S] ~A~%" (type-of condition) condition)
200+
(abort))))
201+
202+
(defun shell-debugger-hook (condition me-or-my-encapsulation)
203+
(declare (ignore me-or-my-encapsulation))
204+
(cond ((typep condition 'warning)
205+
(format *standard-output* "[~S] ~A~%" (type-of condition) condition)
206+
(finish-output *standard-output*)
207+
(muffle-warning))
208+
(t
209+
(let ((env (dissect:capture-environment condition)))
210+
(format *error-output* "[~S] ~A~%" (type-of condition) condition)
211+
(finish-output *error-output*)
212+
(throw 'debug-error
213+
(make-eval-error condition (format nil "~A" condition)
214+
(mapcar (lambda (frame)
215+
(dissect:present frame nil))
216+
(dissect:environment-stack env))))))))
217+
218+
(defun debugger-type ()
219+
(cond ((or (not *enable-debugger*)
220+
#+clasp (core:debugger-disabled-p)
221+
#+sbcl (eq sb-ext:*invoke-debugger-hook* 'sb-debug::debugger-disabled-hook))
222+
:none)
223+
#+abcl
224+
(sys::*invoke-debugger-hook* :external)
225+
#+allegro
226+
(excl::*break-hook* :external)
227+
#+ccl
228+
(ccl:*break-hook* :external)
229+
#+clisp
230+
(sys::*break-driver* :external)
231+
#+clasp
232+
(ext:*invoke-debugger-hook* :external)
233+
#+ecl
234+
(ext:*invoke-debugger-hook* :external)
235+
#+lispworks
236+
(dbg::*debugger-wrapper-list* :external)
237+
#+mezzano
238+
(mezzano.debug:*global-debugger* :external)
239+
#+sbcl
240+
(sb-ext:*invoke-debugger-hook* :external)
241+
(*enable-internal-debugger* :internal)
242+
(t :none)))
243+
244+
(defmacro with-debugger ((&key control internal) &body body)
245+
(let ((debugger-hook (if control
246+
'control-debugger-hook
247+
'shell-debugger-hook)))
248+
`(flet ((body-func ()
249+
(catch 'debug-error
250+
(with-simple-restart
251+
(abort "Exit debugger, returning to top level.")
252+
,@body))))
253+
(case (debugger-type)
254+
(:external
255+
(body-func))
256+
,@(when internal
257+
#+clasp
258+
`((:internal
259+
(catch sys::*quit-tag*
260+
(body-func))))
261+
#-clasp
262+
`((:internal
263+
(body-func))))
264+
(otherwise
265+
(let ((*debugger-hook* ',debugger-hook)
266+
#+sbcl (sb-ext:*invoke-debugger-hook* ',debugger-hook)
267+
#+ccl (ccl:*break-hook* ',debugger-hook)
268+
#+ecl (ext:*invoke-debugger-hook* ',debugger-hook)
269+
#+clasp (ext:*invoke-debugger-hook* ',debugger-hook)
270+
#+abcl (sys::*invoke-debugger-hook* ',debugger-hook)
271+
#+clisp (sys::*break-driver* (lambda (continuable &optional condition print)
272+
(declare (ignore continuable print))
273+
(,debugger-hook condition nil)))
274+
#+allegro (excl::*break-hook* (lambda (&rest args)
275+
(,debugger-hook (fifth args))))
276+
#+lispworks (dbg::*debugger-wrapper-list* (lambda (function condition)
277+
(declare (ignore function))
278+
(,debugger-hook condition nil)))
279+
#+mezzano (mezzano.debug:*global-debugger* (lambda (condition)
280+
(,debugger-hook condition nil))))
281+
(body-func)))))))

src/widgets/trait-types.lisp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
(declare (ignore object type name))
2121
(values :null (list nil) (list value)))
2222

23-
#+(or abcl allegro ccl clasp cmu ecl lispworks sbcl)
23+
#+(or); abcl allegro ccl clasp cmu ecl lispworks sbcl)
2424
(defmethod deserialize-trait (object (type (eql :buffer)) name (value vector))
2525
(declare (ignore type name))
2626
(if (binary-value-p value)
@@ -217,7 +217,7 @@
217217
(declare (ignore object type name))
218218
(values :null (list nil) (list value)))
219219

220-
#+(or abcl allegro ccl clasp cmu ecl lispworks sbcl)
220+
#+(or); abcl allegro ccl clasp cmu ecl lispworks sbcl)
221221
(defmethod deserialize-trait (object (type (eql :single-float-buffer)) name (value vector))
222222
(declare (ignore type name))
223223
(if (binary-value-p value)

0 commit comments

Comments
 (0)