From f7e489178120813a4aff0eff0140661bf402cbae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 17 Aug 2020 10:17:33 +0200 Subject: Work on paths? --- module/util.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'module/util.scm') diff --git a/module/util.scm b/module/util.scm index d5cf86a7..17400c3b 100644 --- a/module/util.scm +++ b/module/util.scm @@ -300,6 +300,12 @@ (if (> i (string-length str)) str (string-take str i))) +(define-public (string-first str) + (string-ref str 0)) + +(define-public (string-last str) + (string-ref str (1- (string-length str)))) + (define-public (as-symb s) (if (string? s) (string->symbol s) s)) @@ -546,6 +552,17 @@ +(define-syntax catch-warnings + (syntax-rules () + ((_ default body ...) + (parametrize ((warnings-are-errors #t)) + (catch 'warning + (lambda () + body ...) + (lambda _ default)))))) + + + (define-syntax let-env (syntax-rules () [(_ ((name value) ...) -- cgit v1.2.3