Skip to content

Instantly share code, notes, and snippets.

@slyrus
slyrus / gist:53113ed2da59f47980846c1497be1e14
Created September 24, 2020 19:18
CLASP/McCLIM build error
Cannot add the method #<STANDARD-METHOD UNNAMED (CLIM-INTERNALS::|(presentation-type COMMON-LISP::NULL)|
T T
CLIM:TEXTUAL-VIEW)> to the generic function #<PRESENTATION-GENERIC-FUNCTION CLIM-INTERNALS::%ACCEPT> because their lambda lists (TYPE-KEY
TYPE
STREAM
VIEW
#+abcl
(progn
(require :abcl-contrib)
(require :jss))
#+abcl
(defun get-java-fields (object fields)
(reduce (lambda (x y)
(jss:get-java-field x y t))
Segmentation fault. Attempted to access resticted memory address #x7F438B9AF000.
This is due either to a problem in foreign code (e.g., C++), or a bug in Clasp itself.
[Condition of type EXT:SEGMENTATION-VIOLATION]
Restarts:
0: [TRY-RECOMPILING] Recompile reader and try loading it again
1: [RETRY] Retry loading FASL for #<CL-SOURCE-FILE "fset" "Code" "reader">.
2: [ACCEPT] Continue, treating loading FASL for #<CL-SOURCE-FILE "fset" "Code" "reader"> as having been successful.
3: [RETRY] Retry ASDF operation.
sly@boombox:~/src/clasp$ ./build/boehm/iclasp-boehm
Starting cclasp-boehm-0.4.2-2145-gc6af40bcf-cst ... loading image...
; caught ERROR:
; ERROR while evaluating compiler-time side effect:
; The function CLEAVIR-PRIMOP:CST-TO-AST is undefined.
; at /home/sly/quicklisp/quicklisp/deflate.lisp 197:0
;
Condition of type: EVAL-ERROR
ERROR while evaluating compiler-time side effect:
@slyrus
slyrus / with-assoc.lisp
Created August 27, 2019 23:17
with-assoc
(defmacro with-assoc (associations object &body body)
(let ((obj (gensym)))
`(let ((,obj ,object))
(declare (ignorable ,obj))
(symbol-macrolet
,(mapcar (lambda (association-entry)
(destructuring-bind (assoc-name var-name)
association-entry
`(,var-name (cdr (assoc ,assoc-name ,obj)))))
associations)
so I don't forget about this...
modified Core/clim-basic/recording.lisp
@@ -1328,7 +1328,7 @@ were added."
(multiple-value-bind (ex2 ey2)
(normalize-coords (- x xn) (- y yn))
(let* ((cos-a (+ (* ex1 ex2) (* ey1 ey2)))
- (sin-a/2 (sqrt (* 0.5 (- 1.0 cos-a)))))
+ (sin-a/2 (realpart (sqrt (* 0.5 (- 1.0 cos-a))))))
(if (< sin-a/2 sin-limit)
@slyrus
slyrus / gist:d63f465751b332e81ba33f6d659b0624
Created September 19, 2018 03:34
mcclimi accepting values error
The value
10487096
is not of type
(INTEGER 0 0)
when binding #:G2
[Condition of type TYPE-ERROR]
Restarts:
0: [TRY-AGAIN] Try executing the command COM-ACCEPTING-INTERVAL again
1: [ABORT] Return to application command loop
@slyrus
slyrus / sbcl-mcclim-breakage
Created September 10, 2018 04:41
"Pass the FP for indirect lambda vars once" SBCL commit breaks McCLIM
There is no applicable method for the generic function
#<STANDARD-GENERIC-FUNCTION CLIM:REGION-UNION (44)>
when called with arguments
(#1=#<CLIM-INTERNALS::PORT-EVENT-QUEUE {10197C60D3}> #1#).
[Condition of type SB-PCL::NO-APPLICABLE-METHOD-ERROR]
Restarts:
0: [RETRY] Retry calling the generic function.
1: [ABORT] Return to application command loop
2: [RETRY] Retry SLIME REPL evaluation request.
@slyrus
slyrus / gist:c0ea2411242b42662bfea5eabfa708db
Last active April 21, 2018 18:16
macroexapnded clem::defmatrix-funcs
(PROGN
(PROGN
(EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) (SB-PCL::COMPILE-OR-LOAD-DEFGENERIC 'ARRAY->T-MATRIX))
(SB-PCL::LOAD-DEFGENERIC 'ARRAY->T-MATRIX '(A) (SB-C:SOURCE-LOCATION))
(FDEFINITION 'ARRAY->T-MATRIX))
(PROGN
(EVAL-WHEN (:COMPILE-TOPLEVEL :EXECUTE) (SB-PCL::COMPILE-OR-LOAD-DEFGENERIC 'ARRAY->T-MATRIX))
(EVAL-WHEN (:LOAD-TOPLEVEL)
(SB-PCL::LOAD-DEFMETHOD 'STANDARD-METHOD 'ARRAY->T-MATRIX 'NIL (LIST (FIND-CLASS 'ARRAY)) '(A)
(LIST* :FUNCTION
(cl:defpackage :funcall-instance-test
(:use #:cl))
(cl:in-package #:funcall-instance-test)
(defclass my-funcallable-instance ()
((name :initarg :name :initform nil :accessor fin-name)
(function :initarg :function :initform nil :accessor fin-function))
(:metaclass sb-mop:funcallable-standard-class))