diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-22 23:36:44 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-22 23:36:44 +0200 |
commit | ec6ec884401922aa09325046d779d8f165995ab3 (patch) | |
tree | eaeed7f35443a5a48928dfb1ed4f3227459e1818 /module/hnh | |
parent | Rewrote define-define-peg-pattern. (diff) | |
download | calp-ec6ec884401922aa09325046d779d8f165995ab3.tar.gz calp-ec6ec884401922aa09325046d779d8f165995ab3.tar.xz |
Replace define-macro with define-syntax in (hnh util).
Diffstat (limited to '')
-rw-r--r-- | module/hnh/util.scm | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/module/hnh/util.scm b/module/hnh/util.scm index f95a24bf..1fa3eb83 100644 --- a/module/hnh/util.scm +++ b/module/hnh/util.scm @@ -60,12 +60,6 @@ #'(let ((it condition)) (when it body ...)))])) -#; -(define-macro (awhen pred . body) - `(let ((it ,pred)) - (when it - ,@body))) - (define-syntax for @@ -88,13 +82,13 @@ -(define-macro (print-and-return expr) - (let ((str (gensym "str")) - (result (gensym "result"))) - `(let* ((,result ,expr) - (,str (format #f "~a [~a]~%" ,result (quote ,expr)))) - (display ,str (current-error-port)) - ,result))) + +(define-syntax-rule (print-and-return expr) + (let ((result expr)) + (display (format #f "~a [~a]~%" result (quote expr)) + (current-error-port)) + result)) + |