>From 8cb3431a87c5e2466ea8582c9a27498e3f0f9e96 Mon Sep 17 00:00:00 2001 From: Alaric Snell-Pym Date: Thu, 8 Mar 2012 21:06:10 +0000 Subject: [PATCH] Rather than requiring assert's message to statically be a string, instead allow it to be an expression that evaluates (at assertion failure time) to something that can be turned into a string. No documentation changes were required, as I believe this is the behaviour implied by the documentation to begin with... --- chicken-syntax.scm | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/chicken-syntax.scm b/chicken-syntax.scm index 71576b2..14221ae 100644 --- a/chicken-syntax.scm +++ b/chicken-syntax.scm @@ -176,12 +176,10 @@ (msg-and-args (cddr form)) (msg (if (null? msg-and-args) "assertion failed" - (let ((msg-str (car msg-and-args))) - (##sys#check-string msg-str 'assert) - msg-str))) + (car msg-and-args))) (msg (if ln - (string-append "(" ln ") " msg) - msg))) + `(,(r 'string-append) "(" ,ln ") " (,(r '->string) ,msg)) + `(,(r '->string) ,msg)))) `(##core#if (##core#check ,exp) (##core#undefined) (##sys#error -- 1.7.4.1