diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-17 10:17:33 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-17 10:17:33 +0200 |
commit | f7e489178120813a4aff0eff0140661bf402cbae (patch) | |
tree | c55d3ec6ee869a29dd892c8573734df6e18236f6 /module/util.scm | |
parent | Setup directories for dist. (diff) | |
download | calp-f7e489178120813a4aff0eff0140661bf402cbae.tar.gz calp-f7e489178120813a4aff0eff0140661bf402cbae.tar.xz |
Work on paths?
Diffstat (limited to '')
-rw-r--r-- | module/util.scm | 17 |
1 files changed, 17 insertions, 0 deletions
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) ...) |