Skip to content

Instantly share code, notes, and snippets.

View kchanqvq's full-sized avatar
🦇
NEETing

kchan! kchanqvq

🦇
NEETing
View GitHub Profile
@kchanqvq
kchanqvq / flex.lisp
Last active December 18, 2021 21:18
simple flex score function for nyxt
(in-package :prompter)
(defun score-suggestion-string (input suggestion-string)
(let ((i 0)
(score 0.0))
(declare (optimize (speed 3) (safety 0))
(type single-float score) (type fixnum i)
(type (simple-array character) input suggestion-string))
(loop for c across input do
(let ((next (position c suggestion-string :start i :test 'eq)))
(if next
@kchanqvq
kchanqvq / describe-all.lisp
Created December 18, 2021 22:21
Describe-all
(define-command-global describe-all ()
"Prompt for a symbol in any Nyxt-accessible package and describe it in the best way Nyxt can."
(let* ((all-symbols
(delete-duplicates
(apply #'append (loop for package in (remove (find-package "KEYWORD") (list-all-packages))
collect (loop for sym being the external-symbols in package
collect sym)))))
;; All copied from /nyxt/source/help.lisp with `describe-any' as a reference.
(classes (remove-if (lambda (sym)
(not (and (find-class sym nil)
(defpackage #:petalisp.lite-backend
(:use #:common-lisp
#:petalisp.core)
(:import-from #:petalisp.native-backend
#:denv
#:make-denv
#:cenv
#:make-cenv
#:allocations
#:schedule