From d6e473068e2241628371e9a29742d81f41ac1788 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 22 Jan 2020 21:40:14 +0000 Subject: feat(third_party/lisp): Add 'iterate' and 'quasiquote-2.0' packages --- third_party/lisp/iterate.nix | 15 +++++++++++++++ third_party/lisp/quasiquote_2/default.nix | 17 +++++++++++++++++ third_party/lisp/quasiquote_2/quasiquote-2.0.lisp | 6 +++--- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 third_party/lisp/iterate.nix create mode 100644 third_party/lisp/quasiquote_2/default.nix (limited to 'third_party') diff --git a/third_party/lisp/iterate.nix b/third_party/lisp/iterate.nix new file mode 100644 index 000000000000..b9309c36b4ba --- /dev/null +++ b/third_party/lisp/iterate.nix @@ -0,0 +1,15 @@ +# iterate is an iteration construct for Common Lisp, similar to the +# LOOP macro. +{ pkgs, ... }: + +let src = builtins.fetchGit { + url = "https://gitlab.common-lisp.net/iterate/iterate.git"; + rev = "a1c47b2b74f6c96149d717be90c07a1b273ced69"; +}; +in pkgs.nix.buildLisp.library { + name = "iterate"; + srcs = [ + "${src}/package.lisp" + "${src}/iterate.lisp" + ]; +} diff --git a/third_party/lisp/quasiquote_2/default.nix b/third_party/lisp/quasiquote_2/default.nix new file mode 100644 index 000000000000..3febfca2b68d --- /dev/null +++ b/third_party/lisp/quasiquote_2/default.nix @@ -0,0 +1,17 @@ +# Quasiquote more suitable for macros that define other macros +{ pkgs, ... }: + +pkgs.nix.buildLisp.library { + name = "quasiquote-2.0"; + + deps = [ + pkgs.third_party.lisp.iterate + ]; + + srcs = [ + ./package.lisp + ./quasiquote-2.0.lisp + ./macros.lisp + ./readers.lisp + ]; +} diff --git a/third_party/lisp/quasiquote_2/quasiquote-2.0.lisp b/third_party/lisp/quasiquote_2/quasiquote-2.0.lisp index 9ce0425d56af..10043fe0ecbc 100644 --- a/third_party/lisp/quasiquote_2/quasiquote-2.0.lisp +++ b/third_party/lisp/quasiquote_2/quasiquote-2.0.lisp @@ -26,6 +26,9 @@ (defparameter *injectors* nil) +(defparameter *void-elt* nil) +(defparameter *void-filter-needed* nil) + ;; (defmacro with-injector-parsed (form) ;; `(let ((kwd (intern (string @@ -199,9 +202,6 @@ (and (consp form) (find (car form) *known-macro-injectors* :test #'eq))) -(defparameter *void-elt* nil) -(defparameter *void-filter-needed* nil) - (defun filter-out-voids (lst void-sym) (let (caars cadrs cdars cddrs) ;; search for all occurences of VOID -- cgit 1.4.1