aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-01-16 01:22:52 +0530
committerArun Isaac2022-01-16 12:24:44 +0530
commit0cdeada6b3dec0d5eab1648cc5d7c627b593d498 (patch)
treef24d0508e378af5313959de415854878fe25030d
parent72343067effad906a01f43798d01ed974cd005f8 (diff)
downloadccwl-0cdeada6b3dec0d5eab1648cc5d7c627b593d498.tar.gz
ccwl-0cdeada6b3dec0d5eab1648cc5d7c627b593d498.tar.lz
ccwl-0cdeada6b3dec0d5eab1648cc5d7c627b593d498.zip
ccwl: Add &formatted-message condition.
* ccwl/conditions.scm (&formatted-message): New condition. (formatted-message): New function.
-rw-r--r--ccwl/conditions.scm17
1 files changed, 16 insertions, 1 deletions
diff --git a/ccwl/conditions.scm b/ccwl/conditions.scm
index 2c69cea..c6523cb 100644
--- a/ccwl/conditions.scm
+++ b/ccwl/conditions.scm
@@ -29,7 +29,11 @@
invalid-keyword-arity-assertion
invalid-keyword-arity-assertion?
invalid-positional-arguments-arity-assertion
- invalid-positional-arguments-arity-assertion?))
+ invalid-positional-arguments-arity-assertion?
+ formatted-message
+ formatted-message?
+ formatted-message-format
+ formatted-message-arguments))
(define-condition-type &ccwl-violation &violation
make-ccwl-violation ccwl-violation?
@@ -52,3 +56,14 @@
(define-condition-type &invalid-positional-arguments-arity-assertion &assertion
invalid-positional-arguments-arity-assertion invalid-positional-arguments-arity-assertion?)
+
+(define-condition-type &formatted-message &message
+ make-formatted-message formatted-message?
+ (format formatted-message-format)
+ (arguments formatted-message-arguments))
+
+(define (formatted-message format-string . arguments)
+ "Return &ccwl-message condition for FORMAT-STRING with ARGUMENTS."
+ (make-formatted-message (apply format format-string arguments)
+ format-string
+ arguments))