about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-01-24T10·52+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-01-24T10·52+0000
commit95d03facb3af93323101737d76470f190e7ca2ae (patch)
treeccca388ec70f33fdb678d4888e095a2c0dd6a9f1
parentb6fa3941b3731e959a7f54bf8e68e43e9077bf90 (diff)
Support prelude.lisp
Using this module to support utility functions that I have not classified
further than being miscellaneous.
-rw-r--r--lisp/main.lisp15
-rw-r--r--lisp/prelude.lisp14
-rw-r--r--lisp/prelude.nix8
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
+  ];
+}