This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: printing types ?
- To: Han-Wen Nienhuys <hanwen at cs dot uu dot nl>
- Subject: Re: printing types ?
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Tue, 7 Mar 2000 15:07:33 +0100 (MET)
- cc: guile at sourceware dot cygnus dot com
On Tue, 7 Mar 2000, Han-Wen Nienhuys wrote:
> is there a generic way to print types from within GUILE? eg.
>
> 1 => integer
>
> #t => boolean
>
> etc.?
I don't think so. Especially since there are some cases, where it is not
obvious what information is thought of:
(1 2) --> pair or list or regular list
(1 . 2) --> pair or irregular list
(1 . #0#) --> pair or infinite list or circular list or ...
1 -> integer or exact integer
...
Thinking of gregs recent patch to improve messages for wrong type
parameters, which added telling you which type was expected, I
also had the idea to add the information, what type was actually
provided. However, I figured out that you would have to do this
separately for each point in the code where an error message was
generated, as you can see from the following artificial example:
(list->string '(#\a #\b 1))
Error in function list->string: expected list of characters, got pair.
:-)
Best regards
Dirk Herrmann