3 (defvar *cargo-target* #P"/Users/ellis/dev/otom8/demo/target/") 5 (defmacro find-rust-dll (name &optional debug) 6 "Find the rust dll specified by NAME." 8 ((uiop:directory-exists-p (merge-pathnames *cargo-target* "release")) 9 `,(mkstr "./target/release/" name)) 10 ((uiop:directory-exists-p (merge-pathnames *cargo-target* "debug")) 11 `,(mkstr "./target/debug/" name)) 13 (uiop:run-program `("cargo" "build" ,(unless debug "--release")) :output t) 14 `,(find-rust-dll name debug))))) 17 (format NIL "~8,'0x-~8,'0x" (random #xFFFFFFFF) (get-universal-time))) 19 (defun scan-dir (dir filename callback) 20 (dolist (path (directory (merge-pathnames (merge-pathnames filename "**/") dir))) 21 (funcall callback path))) 23 (defun mkstr (&rest args) 24 (with-output-to-string (s) 25 (dolist (a args) (princ a s)))) 27 (defun symb (&rest args) 28 (values (intern (apply #'mkstr args)))) 30 (defun sbq-reader (stream sub-char numarg) 31 "The anaphoric sharp-backquote reader: #`((,a1))" 32 (declare (ignore sub-char)) 33 (unless numarg (setq numarg 1)) 34 `(lambda ,(loop for i from 1 to numarg 37 (get-macro-character #\`) stream nil))) 40 (set-dispatch-macro-character 41 #\# #\` #'demo:sbq-reader))