diff options
-rw-r--r-- | lisp/main.lisp | 15 | ||||
-rw-r--r-- | lisp/prelude.lisp | 14 | ||||
-rw-r--r-- | lisp/prelude.nix | 8 |
3 files changed, 22 insertions, 15 deletions
diff --git a/lisp/main.lisp b/lisp/main.lisp deleted file mode 100644 index 2c4a5a411635..000000000000 --- 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 000000000000..3522567ea0f7 --- /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 000000000000..9051f82394ff --- /dev/null +++ b/lisp/prelude.nix @@ -0,0 +1,8 @@ +{ depot ? import <depot> {}, ... }: + +depot.nix.buildLisp.library { + name = "prelude"; + srcs = [ + ./prelude.lisp + ]; +} |