]> jfr.im git - irc/thales.git/blobdiff - src/thales/syntax.scm
Remove unused files
[irc/thales.git] / src / thales / syntax.scm
diff --git a/src/thales/syntax.scm b/src/thales/syntax.scm
deleted file mode 100644 (file)
index 2bef128..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-(define-module (thales syntax)
-    #:use-module (srfi srfi-1)
-    #:use-module (srfi srfi-26)
-    #:use-module (ice-9 match)
-    #:re-export (cute)
-    #:export (lambda-match for for* define-match push))
-
-(define-syntax push
-    (syntax-rules ()
-        ((_ val list)
-         (set! list (cons val list)))))
-
-(define (cute-reader ch stream)
-    (define (append-<...> list)
-        (if (eq? (last list) '<...>)
-            list
-            (append list '(<...>))))
-    (unread-char ch stream)
-    (cons '(@ (srfi srfi-26) cute)
-           (append-<...> (read stream))))
-
-(eval-when (eval load compile)
-    (read-hash-extend #\[
-        (lambda (ch stream)
-            ((@@ (thales syntax) cute-reader) ch stream))))
-
-(eval-when (load compile eval)
-    (read-hash-extend #\~
-        (lambda (ch stream)
-           (let ((next-char (read-char stream)))
-               (unread-char next-char stream)
-               (let ((next-sexp (read stream)))
-                   (case next-char
-                       [(#\() `(let () ,@next-sexp)]
-                       [(#\[) `(lambda () ,@next-sexp)]))))))
-
-(define-syntax nested-match
-    (syntax-rules ()
-        (( _ (var) (pat) exp exps ...)
-         (match var (pat #~(exp exps ...))))
-        (( _ (var vars ...) (pat pats ...) exp exps ...)
-         (match var (pat (nested-match (vars ...) (pats ...) exp exps ...))))))
-
-(define-syntax lambda-match
-    (lambda (x)
-        (syntax-case x ()
-            ((_ (pat ...) exp exps ...)
-             (with-syntax
-              (((t ...) (generate-temporaries #'(pat ...))))
-              #'(lambda (t ...)
-                    (nested-match (t ...) (pat ...) exp exps ... )))))))
-
-(define-syntax define-match
-    (syntax-rules ()
-        ((_ (name args ...) expr ...)
-         (define name (lambda-match (args ...) expr ...)))))
-
-(define-syntax for
-    (syntax-rules (=>)
-        ((_ (key => val) in hash exp exps ...)
-         (hash-for-each (lambda-match (key val) exp exps ...) hash))
-        ((_ (pat in list) exp exps ...)
-         (for-each (lambda-match (pat) exp exps ...) list))))
-
-(define-syntax for*
-    (syntax-rules (=>)
-       ((_ ((key => val) in hash) exp exps ...)
-        (hash-map->list (lambda-match (key val) exp exps ...) hash))
-       ((_ (pat in list) exp exps ...)
-        (map (lambda-match (pat) exp exps ...) list))))