diff --git a/lisp/main.lisp b/lisp/main.lisp deleted file mode 100644 index 2c4a5a411..000000000 --- a/lisp/main.lisp +++ /dev/null @@ -1,15 +0,0 @@ -(in-package #:cl-user) -(defpackage #:utils - (:documentation "Some utility functions and macros to wet my beak.") - (:use #:cl) - (:shadow #:type)) -(in-package #:utils) - -(defmacro type (name in out) - `(declaim (ftype (function ,in ,out) ,name))) - -(defmacro comment (&rest _forms) nil) - -(type add (int int) int) -(defun add (a b) - (+ a b)) diff --git a/lisp/prelude.lisp b/lisp/prelude.lisp new file mode 100644 index 000000000..3522567ea --- /dev/null +++ b/lisp/prelude.lisp @@ -0,0 +1,14 @@ +(in-package #:cl-user) +(defpackage #:prelude + (:documentation "Supporting miscellaneous utility functions and macros.") + (:use #:cl) + (:shadow #:type) + (:export #:type #:comment)) +(in-package #:prelude) + +;; TODO: Add documentation to these macros. + +(defmacro type (name in out) + `(declaim (ftype (function ,in ,out) ,name))) + +(defmacro comment (&rest _forms) nil) diff --git a/lisp/prelude.nix b/lisp/prelude.nix new file mode 100644 index 000000000..9051f8239 --- /dev/null +++ b/lisp/prelude.nix @@ -0,0 +1,8 @@ +{ depot ? import {}, ... }: + +depot.nix.buildLisp.library { + name = "prelude"; + srcs = [ + ./prelude.lisp + ]; +}