# HG changeset patch # User Steve Losh # Date 1490811614 0 # Node ID 6f43a660d22a84340ef8ac3f4e9d2f67c2670950 # Parent a5086be7e1aae4fd55a4d77dbafea791c14b5e27 Remove the stupid cl-arrows dep diff -r a5086be7e1aa -r 6f43a660d22a contrib/gdl-benchmark/run_temperance.ros --- a/contrib/gdl-benchmark/run_temperance.ros Tue Mar 14 13:33:03 2017 +0000 +++ b/contrib/gdl-benchmark/run_temperance.ros Wed Mar 29 18:20:14 2017 +0000 @@ -33,9 +33,9 @@ (defpackage :temperance.contrib.gdl-benchmark (:use :cl - :cl-arrows :losh :temperance.quickutils + :temperance.utils :temperance)) (in-package :temperance.contrib.gdl-benchmark) diff -r a5086be7e1aa -r 6f43a660d22a package.lisp --- a/package.lisp Tue Mar 14 13:33:03 2017 +0000 +++ b/package.lisp Wed Mar 29 18:20:14 2017 +0000 @@ -1,9 +1,10 @@ (defpackage :temperance.utils (:use :cl - :cl-arrows :temperance.quickutils) (:export + :-<> + :<> :push-if-new :recursively :recur @@ -56,7 +57,6 @@ (defpackage :temperance (:use :cl - :cl-arrows :temperance.circle :temperance.quickutils :temperance.utils) diff -r a5086be7e1aa -r 6f43a660d22a src/compiler/4-tokenization.lisp --- a/src/compiler/4-tokenization.lisp Tue Mar 14 13:33:03 2017 +0000 +++ b/src/compiler/4-tokenization.lisp Wed Mar 29 18:20:14 2017 +0000 @@ -129,7 +129,7 @@ "Tokenize `term` as a program term, returning its tokens." (let ((tree (parse-top-level term))) (allocate-registers tree clause-props :nead t) - (-> tree flatten-program tokenize-assignments))) + (-<> tree flatten-program tokenize-assignments))) (defun tokenize-query-term (term clause-props &key in-nead is-tail) "Tokenize `term` as a query term, returning its tokens." diff -r a5086be7e1aa -r 6f43a660d22a src/compiler/6-optimization.lisp --- a/src/compiler/6-optimization.lisp Tue Mar 14 13:33:03 2017 +0000 +++ b/src/compiler/6-optimization.lisp Wed Mar 29 18:20:14 2017 +0000 @@ -103,9 +103,9 @@ (defun optimize-instructions (instructions) - (->> instructions - (optimize-constants) - (optimize-void-runs))) + (-<> instructions + optimize-constants + optimize-void-runs)) diff -r a5086be7e1aa -r 6f43a660d22a src/ui.lisp --- a/src/ui.lisp Tue Mar 14 13:33:03 2017 +0000 +++ b/src/ui.lisp Wed Mar 29 18:20:14 2017 +0000 @@ -324,9 +324,9 @@ (let* ((,code (allocate-query-holder))) (multiple-value-bind (,vars ,size) (compile-query-into - ,code ',(->> terms - (mapcar #'eval) - (mapcar #'normalize-term))) + ,code ',(-<> terms + (mapcar #'eval <>) + (mapcar #'normalize-term <>))) (list ,code ,size ,vars))) t)))) diff -r a5086be7e1aa -r 6f43a660d22a src/utils.lisp --- a/src/utils.lisp Tue Mar 14 13:33:03 2017 +0000 +++ b/src/utils.lisp Wed Mar 29 18:20:14 2017 +0000 @@ -176,3 +176,18 @@ `(let ((,$keyform ,keyform)) ,(%case/tree $keyform (sort (copy-list cases) #'< :key #'first)))))) + +;;;; Threading Macro +(defmacro -<> (expr &rest forms) + "Thread the given forms, with `<>` as a placeholder." + ;; I am going to lose my fucking mind if I have to program lisp without + ;; a threading macro, but I don't want to add another dep to this library, so + ;; here we are. + `(let* ((<> ,expr) + ,@(mapcar (lambda (form) + (if (symbolp form) + `(<> (,form <>)) + `(<> ,form))) + forms)) + <>)) + diff -r a5086be7e1aa -r 6f43a660d22a temperance.asd --- a/temperance.asd Tue Mar 14 13:33:03 2017 +0000 +++ b/temperance.asd Wed Mar 29 18:20:14 2017 +0000 @@ -7,8 +7,7 @@ :license "MIT" :version "1.0.0" - :depends-on (:cl-arrows - :policy-cond) + :depends-on (:policy-cond) :in-order-to ((asdf:test-op (asdf:test-op :temperance.test)))