Created
January 20, 2022 12:59
-
-
Save emacdona/cf7b6376418b224be9f0401df433bccd 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 ,(funcall l))) | |
(execute-lambda-at-compile-time-b (l) \`(quote ,(funcall (eval l)))) | |
(run-example (symbol) | |
\`(handler-case (,symbol (lambda () 'hello)) | |
(error (e) (format nil "~a" e))))) | |
(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-clisp \ | |
-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