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
(defvar *projects* nil) | |
(defmacro defproject (project-name (project-domain &key use) | |
&body project-routes) | |
(let ((project (alexandria:make-keyword project-name))) | |
(pushnew project *projects*) | |
(eval |
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
(sort | |
(remove-if #'null | |
(mapcar (lambda (release) | |
(cons (ql-dist:name release) | |
(release-last-updated-date release))) | |
(ql-dist:provided-releases (ql-dist:find-dist "quicklisp"))) | |
:key #'cdr) | |
#'local-time:timestamp< | |
:key #'cdr) |
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 release-last-updated-date (quicklisp-release) | |
(ppcre:register-groups-bind (year month day) | |
("-(\\d{4})(\\d{2})(\\d{2})(?:-|$)" (ql-dist:prefix quicklisp-release)) | |
(local-time:encode-timestamp 0 0 0 0 (parse-integer day) (parse-integer month) (parse-integer year)))) |
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
(mapcar (lambda (d) | |
(format nil "~{~a~^-~}" | |
(series:collect | |
(series:until-if | |
(lambda (string-part) | |
(ppcre:scan "^\\d{8}$" string-part)) | |
(series:scan (ppcre:split "-" (lastcar (pathname-directory d)))))))) | |
(list-directory | |
(merge-pathnames | |
#P"software/" |
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
(mapc #'ql::ensure-installed | |
(ql-dist:provided-releases | |
(ql-dist:find-dist "quicklisp"))) |
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
The value #<TRANSFORM :FLOAT | |
{0.0031 0.0000 0.0000 0.0000 | |
0.0000 0.0042 0.0000 0.0000 | |
0.0000 0.0000 0.0100 0.0000 | |
0.0000 0.0000 -0.0025 1.0000}> | |
is not of type | |
ARRAY. | |
[Condition of type TYPE-ERROR] | |
Restarts: |
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 forgiving-subseq (seq &key (start 0) (seq-length (length seq)) (end seq-length)) | |
(let ((empty-seq (subseq seq 0 0))) | |
(cond ((> start seq-length) empty-seq) | |
(t (subseq seq start (min seq-length end)))))) | |
(defun group-seq (seq group-size) | |
(unless (and (>= group-size 1) | |
(integerp group-size)) | |
(error "Group size must be an integer greater than zero.")) | |
(loop with seq-length = (length seq) |
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-USER> (fad:pathname-as-directory #P"/Users/joekarma/src/tmp/test\\[one]") | |
#P"/Users/joekarma/src/tmp/test\\\\[one]/" | |
CL-USER> (fad:pathname-as-directory #P"/Users/joekarma/src/tmp/test\\[one]/") | |
#P"/Users/joekarma/src/tmp/test\\[one]/" |
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-USER> (defun gethash* (hash-table key &rest more-keys) | |
(cond ((null more-keys) (gethash key hash-table)) | |
(t (apply #'gethash* | |
(append (list (gethash key hash-table) | |
(car more-keys)) | |
(cdr more-keys)))))) | |
GETHASH* | |
CL-USER> (gethash* (yason:parse "{foo:{bar:{baz:42}}}") "foo" "bar" "baz") | |
42 | |
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
(defpackage :foo | |
(:use :cl) | |
(:export :baz)) | |
(in-package :foo) | |
(defun baz () | |
3) | |
(defpackage :bar |