This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rm -rf /tmp/iolib-fasl/ | |
sbcl --no-userinit --script <<EOT | |
(in-package :common-lisp-user) | |
(load #P"~/quicklisp/setup.lisp") | |
(asdf:enable-asdf-binary-locations-compatibility | |
:centralize-lisp-binaries t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cl:defun :toggle (symbol) | |
(cl:if (cl:find symbol cl:*features*) | |
(cl:progn | |
(cl:setf cl:*features* (cl:remove symbol cl:*features*)) | |
cl:nil) | |
(cl:progn | |
(cl:push symbol cl:*features*) | |
symbol))) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro def-print-string (name string) | |
`(defun ,name () | |
(let ((one (count t'(t)))) | |
(coerce | |
(mapcar #'code-char | |
(list | |
,@(loop :for i :across string | |
:collect | |
`(+ ,@(loop :for j := (char-code i) :then (floor j #.(count t'(t t))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun which (bin &key a) | |
(let* ((paths (mapcar #'(lambda (x) (make-pathname :defaults (format nil "~A/" x))) | |
(asdf::split-string (asdf::getenv "PATH") :separator '(#\:)))) | |
found) | |
(setq found (flet ((test (x y) | |
(cl-fad:file-exists-p (merge-pathnames x y)))) | |
(if a | |
(remove bin paths :test (complement #'test)) | |
(find bin paths :test #'test)))) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(format t "~&~@{~{~A~^ ~}~^~%~}" | |
`("Lisp:" ,(lisp-implementation-type) ,(lisp-implementation-version)) | |
#+quicklisp `("Quicklisp:" "Version",(quicklisp-client::local-version) ,(ql-dist:all-dists)) | |
#-quicklisp `("Quicklisp:" "Not installed")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- lisp -*- | |
(defvar *current-dir* (make-pathname :type nil :name nil :defaults *load-pathname*)) | |
(push (merge-pathnames "quickdocs/" *current-dir*) | |
asdf:*central-registry*) | |
(defvar *output-dir* (merge-pathnames "out/1st/" *current-dir*)) | |
(ql:quickload '(:quickdocs :iolib.syscalls)) | |
(defun doc (a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ql:quickload '(:cffi :cl-ppcre)) | |
(with-output-to-string (*standard-output*) | |
(handler-bind | |
((cffi:load-foreign-library-error | |
#'(lambda (c) | |
(declare (ignore c)) | |
(invoke-restart 'cffi::use-value "libncursesw.so.5")))) | |
(ql:quickload :cl-charms))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun eltstr->sexp (eltstr base-expr) | |
(loop :with x := base-expr | |
:with gensym := (gensym) | |
:for i :in (mapcar #'(lambda (x) (mapcar (lambda (x) (or (= (length x) 0) | |
(parse-integer x))) (split-sequence:split-sequence #\_ x))) | |
(split-sequence:split-sequence #\/ eltstr)) | |
:do (setq x (cond ((eql (length i) 1) | |
(if (minusp (first i)) | |
`(let ((,gensym ,x)) | |
(nth (+ (length ,gensym) ,(first i)) ,gensym)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ymdhms (&optional (universal-time (get-universal-time))) | |
(or (ignore-errors (format nil "~{~2,'0d~#[~;:~;:~;_~:;/~]~}" | |
(cdddr (nreverse (multiple-value-list (decode-universal-time universal-time)))))) | |
"not-universaltime")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ql:quickload '(:clack :cl-async)) | |
(defpackage websocket.test | |
(:use :cl | |
:clack)) | |
(in-package :websocket.test) | |
(defvar *handler* | |
(clackup |