Skip to content

Instantly share code, notes, and snippets.

@topher6345
Last active August 29, 2015 14:02
Show Gist options
  • Save topher6345/2b89ce56083df4fec68e to your computer and use it in GitHub Desktop.
Save topher6345/2b89ce56083df4fec68e to your computer and use it in GitHub Desktop.
Common Lisp HackNight #1

Common Lisp HackNight1

YESYES

Background

yes is a program that prints y over and over, meant to be piped into the input of programs requiring confirmation.

Our task is to write a program in Common Lisp that prints YES in a similar manner.

Usage

yesyes

Rosetta Code

(loop (write-line "YES")(write-line "Y")(write-line "y")(write-line "yes"))

Thats nice for the interpreter, but how do we make this an executable?

a Compiler for Common Lisp

buildapp

brew install buildapp

buildapp \
    --eval '(defun main (argv) (declare (ignore argv)) (loop (write-line "YES")(write-line "Y")(write-line "y")(write-line "yes")))' \
    --entry main \
    --output yesyes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment