Skip to content

Instantly share code, notes, and snippets.

View jmercouris's full-sized avatar
🌴

John Mercouris jmercouris

🌴
View GitHub Profile
NEXT> (describe (cl-string-match:match-re "lol" "lol"))
#<RE-MATCH "lol">
Class: #<STANDARD-CLASS CL-STRING-MATCH:RE-MATCH>
Wrapper: #<CCL::CLASS-WRAPPER CL-STRING-MATCH:RE-MATCH #x302001220ECD>
Instance slots
CL-STRING-MATCH::MATCH: "lol"
CL-STRING-MATCH::GROUPS: NIL
CL-STRING-MATCH::START-POS: 0
CL-STRING-MATCH::END-POS: 3
(defun variable-inspect (input)
(let* ((help-buffer (generate-new-buffer
(concatenate 'string "HELP-" (symbol-name input)) (document-mode)))
(help-contents (documentation input 'variable))
(insert-help (ps:ps (setf (ps:@ document Body inner-H-T-M-L) help-contents))))
(interface:web-view-execute (view help-buffer) insert-help)
(set-visible-active-buffer help-buffer)))
NEXT> (describe 'ps:ps)
PARENSCRIPT:PS
Type: SYMBOL
Class: #<BUILT-IN-CLASS SYMBOL>
Macro
EXTERNAL in package: #<Package "PARENSCRIPT">
Print name: "PS"
Value: #<Unbound>
Function: #<Compiled-function PARENSCRIPT:PS Macroexpander #x302001735AAF>
Arglist: (&BODY BODY)
> So, I am trying to connect Slime to my running CCL application [01:21]
> I can read all sorts of variables, I can inspect things
> but the issue arises when I attempt to call any objc [01:22]
> [NextApplication lispInterrupt:]: unrecognized selector sent [01:23]
> to instance 0x35bdf0
> I looked at the code, and lispinterrupt appears to be some sort of
subroutine to allow lisp code to execute cocoa/main thread code
>
(defun start-swank ()
(ccl::call-in-event-process
#'(lambda ()
(swank:create-server :port *swank-port* :style :spawn :dont-close t))))
;;;; buffer.lisp --- lisp subroutines for creating / managing buffers
(in-package :next)
(defclass buffer ()
((name :accessor name :initarg :name)
(mode :accessor mode :initarg :mode)
(view :accessor view :initarg :view)
(modes :accessor modes :initarg :modes)))
NEXT> (remove-if #'(lambda (item) (typep item 'document-mode)) (modes prev-buff))
NIL
NEXT> (modes prev-buff)
(#<DOCUMENT-MODE #x302003C3DF2D>)
NEXT> (remove-if #'(lambda (item) (typep item 'document-mode)) (modes prev-buff))
(defclass buffer ()
((name :accessor name :initarg :name)
(mode :accessor mode :initarg :mode)
(view :accessor view :initarg :view)
(modes :accessor modes :initarg :modes)))
(defmethod print-object ((self buffer) stream)
(format stream "~s" (name self)))
(defmethod add-mode ((self buffer) mode &optional (overwrite nil))
(defmethod switch-mode ((buffer buffer) mode-class)
(let ((found-mode (gethash (class-name mode-class) (modes buffer))))
(if found-mode
(setf (mode buffer) found-mode)
nil)))
(describe 'application-mode)
APPLICATION-MODE
Type: SYMBOL
Class: #<BUILT-IN-CLASS SYMBOL>
Function, Type Specifier, Class Name
INTERNAL in package: #<Package "NEXT">
Print name: "APPLICATION-MODE"
Value: #<Unbound>
Function: #<Compiled-function APPLICATION-MODE #x302003D0545F>
Arglist: NIL