[plt-scheme] error reporting in MzScheme

From: MicheleSimionato at libero.it (MicheleSimionato at libero.it)
Date: Thu Oct 23 04:37:32 EDT 2003

Having sent this message to comp.lang.scheme, they suggested me to ask for
help to DrScheme mailing list, so here I am ;)

-----

I have decided to learn Scheme, so I have downloaded DrScheme which 
seems to be the most newbie-friendly Scheme implementation (I think).

The documentation is rather good and the framework nice enough,
even if I would prefer less fancy graphics and more support
for command line development (I work on Linux). For instance, 
here are few things that bother me:

1. if I run mzscheme from the command line, there is no support for
   the GNU readline library (I mean command history) so it is rather 
   unusable;

2. I miss a command line tool such as perldoc or pydoc, to get
   documentation on commands an built-ins;

3. the graphic environment does 2, but it is quite slow, at least 
   on my old Pentium II laptop, and takes a lot of memory.

4. I can run mzscheme from emacs (GNU Emacs 21.2) but I am not
   very satisfied with the default Scheme mode (I am sure there
   are a better Scheme modes somewhere, isn't it?).

All these are minor points and maybe there are workarounds about them; 
however there is a major issue that really annoys me: 

5.  **ERROR REPORTING** !

Nice error reporting is the most essential thing when you learn 
a new language (and even when you already know the language, BTW).

I want to have an informative message of what's going on, and especially
I want to know the *line number* where the error occurred. Now, sometimes
mzscheme reports the line number, sometimes not, particularly when I
use macros. In this case mzscheme does return the error message 
corresponding to the macro expansion (which is okay) but it does 
*not* return the name of the invoked macro, not the line number where 
the macro was defined: so it very difficult (especially in nested 
expressions) to understand the origin of the error.

Moreover, often the error message is reversed. For example
executing the buggy code

(define h (make-hash-table)) 
(display "trying to get 'k\n")
(hash-table-get h 'k)

gives

trying to get 'k
k
hash-table-get: no value found for key:

whereas I should have got
 
trying to get 'k
hash-table-get: no value found for key: k

The reversed error message really annoys me, and it gets even worse
for buggy function calls (the arguments are printed before the
error message). I am sure this is a buffering problem in stderr
and probably it can be fixed. Is this a know issue?
Also, I do I enable the readline support?

TIA,


               Michele Simionato



Posted on the users mailing list.