[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Allow assert to accept an arbitrary expres
From: |
Felix |
Subject: |
Re: [Chicken-hackers] [PATCH] Allow assert to accept an arbitrary expression as the message |
Date: |
Mon, 12 Mar 2012 12:52:24 +0100 (CET) |
From: Alaric Snell-Pym <address@hidden>
Subject: Re: [Chicken-hackers] [PATCH] Allow assert to accept an arbitrary
expression as the message
Date: Mon, 12 Mar 2012 10:21:57 +0000
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 03/10/2012 11:54 AM, Felix wrote:
>
>> Unfortunately "->string" might not always be available in code that uses
>> the "assert" syntax. It would be nice if "assert" only depended on the
>> base library.
>
> Ah-hah! Do you have a suggestion, or shall I do more research as to
> what's available and pick a good way of stringifying arbitrary messages?
> with-output-to-string is probably not an option either, I suppose? It's
> not huge deal to just assume that msg must be a string at run time
> (after all, that's what the documentation states), but I'm keen to make
> error-reporting code very robust to strange inputs, as it's rarely well
> tested and it's a right pain if the error you get from some exceptional
> circumstance is "bad argument type - not a string: some-symbol" ;-)
In the case of "assert", I think it is not too much to expect the user
to pass a string.
cheers,
felix