Last active
January 21, 2022 02:49
-
-
Save emacdona/708b824077cafa0d588e665b8388662f to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
EXAMPLE=$(cat <<EOF | |
(macrolet ((execute-lambda-at-compile-time-a (l) | |
\`(quote | |
,(handler-case (funcall l) | |
(error (e) (format nil "~a" e))))) | |
(execute-lambda-at-compile-time-b (l) | |
\`(quote | |
,(handler-case (funcall (eval l)) | |
(error (e) (format nil "~a" e))))) | |
(run-example (symbol) | |
\`(,symbol (lambda () 'hello)))) | |
(print (list | |
(run-example funcall) | |
(run-example execute-lambda-at-compile-time-b) | |
(run-example execute-lambda-at-compile-time-a) | |
))) | |
EOF | |
) | |
TEMP_DIR=$(mktemp -d) | |
SCRIPT="${TEMP_DIR}/example.lisp" | |
echo "${EXAMPLE}" >> "${SCRIPT}" | |
echo "CLISP:" | |
echo | |
docker \ | |
run -it --rm \ | |
--name example-clisp \ | |
-v "${TEMP_DIR}":"/workdir" \ | |
-w "/workdir" \ | |
daewok/clisp clisp ./example.lisp | |
echo | |
echo | |
echo "SBCL:" | |
docker \ | |
run -it --rm \ | |
--name example-sbcl \ | |
-v "${TEMP_DIR}":"/workdir" \ | |
-w "/workdir" \ | |
daewok/sbcl \ | |
sbcl --script ./example.lisp | grep -v "^;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment