From d31e24aa59daef70a2aa1c3ef16df565b6aafa95 Mon Sep 17 00:00:00 2001 From: Brady McDonough Date: Thu, 25 Feb 2021 08:21:25 -0700 Subject: [PATCH] Added terse redefinitions and module short --- tk/Makefile | 3 +-- tk/short.scm | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tk/short.scm diff --git a/tk/Makefile b/tk/Makefile index bd79cbd..0ae0b4c 100644 --- a/tk/Makefile +++ b/tk/Makefile @@ -1,7 +1,6 @@ TARGET := $(shell guile -c "(display (%site-dir))") CCACHE := $(shell guile -c "(display(%site-ccache-dir))") -OBJ := listlogic.go ports.go mcron.go - +OBJ := listlogic.go mcron.go ports.go short.go .PHONY: all clean install uninstall all: $(OBJ) diff --git a/tk/short.scm b/tk/short.scm new file mode 100644 index 0000000..fd4de5a --- /dev/null +++ b/tk/short.scm @@ -0,0 +1,15 @@ +(define-module (tk short) + #:export (ss> ss< + ssa>) + #:duplicates (warn-override-core warn)) + +(define ss> string->symbol) +(define ss< symbol->string) + +;; Wraps up the common (string->symbol (string-append ...)) form +(define-syntax ssa> + (syntax-rules () + ((ssa> $string . $strings) + (ss> (string-append $string . $strings))) + ((ssa>) + (syntax-error "ssa> needs at least one string argument"))))