diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-01 15:23:57 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-01 15:23:57 +0100 |
commit | b814f06b57e4e442d5f115865d26dfc427c3338a (patch) | |
tree | 096d23adfd823c9f8d31da7bf87f63c65e338e6a /code.scm | |
parent | Fix memmory error. (diff) | |
download | calp-b814f06b57e4e442d5f115865d26dfc427c3338a.tar.gz calp-b814f06b57e4e442d5f115865d26dfc427c3338a.tar.xz |
Add color-if and for-each-in macros.
Diffstat (limited to '')
-rwxr-xr-x | code.scm | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -38,3 +38,14 @@ (time<=? (date->time-utc input-date) (date->time-utc then))))) + +(define-syntax-rule (color-if pred color body ...) + (let ((pred-value pred)) + (format #f "~a~a~a" + (if pred-value color "") + (begin body ...) + (if pred-value STR-RESET "")))) + +(define-syntax-rule (for-each-in lst proc) + (for-each proc lst)) + |