diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-24 17:30:29 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-24 19:18:12 +0200 |
commit | 05be4a61ddfde13ea4f01dca29877992c7b4f965 (patch) | |
tree | 9c0beea7529a9fbf3bb35c6dd1879060715e663f /module/util | |
parent | Remove (vcomponent util). (diff) | |
download | calp-05be4a61ddfde13ea4f01dca29877992c7b4f965.tar.gz calp-05be4a61ddfde13ea4f01dca29877992c7b4f965.tar.xz |
Minor change.
Diffstat (limited to '')
-rw-r--r-- | module/util.scm | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/module/util.scm b/module/util.scm index 617a2ea6..08152c7c 100644 --- a/module/util.scm +++ b/module/util.scm @@ -58,21 +58,19 @@ (begin f ...))])) -(define-syntax aif - (lambda (stx) - (syntax-case stx () - [(_ condition true-clause false-clause) - (with-syntax ((it (datum->syntax stx 'it))) - #'(let ((it condition)) - (if it true-clause false-clause)))]))) - -(define-syntax awhen - (lambda (stx) - (syntax-case stx () - [(_ condition body ...) - (with-syntax ((it (datum->syntax stx 'it))) - #'(let ((it condition)) - (when it body ...)))]))) +(define-syntax (aif stx) + (syntax-case stx () + [(_ condition true-clause false-clause) + (with-syntax ((it (datum->syntax stx 'it))) + #'(let ((it condition)) + (if it true-clause false-clause)))])) + +(define-syntax (awhen stx) + (syntax-case stx () + [(_ condition body ...) + (with-syntax ((it (datum->syntax stx 'it))) + #'(let ((it condition)) + (when it body ...)))])) #; (define-macro (awhen pred . body) @@ -280,7 +278,7 @@ (comperator (get a) (get b))))) -;; Sorts the list @var{items}. @em{May} destroy the input list in the process +;; Sorts the list @var{items}. @emph{May} destroy the input list in the process (define* (sort*! items comperator #:optional (get identity)) "A sort function more in line with how python's sorted works" (sort! items (lambda (a b) |