Error Reporting in UMASS Scheme

Errors and Warnings

The UMASS Scheme system has three components that detect and report errors.

Where error messages come from

UMASS Scheme is implemented on top of the Sussex Poplog system. This means in effect that errors can be detected either in UMASS Scheme or in Poplog. As a general rule, run-time errors are detected by Poplog, while compile-time errors are detected by UMASS Scheme. The following is a typical compile-time error:

=> (if 234)
Error: Badly formed "if" expression (if 234)
In file: /users/users3/fac/pop/poplocal/local/Scheme/output.scm
In or around line 12: (if 234)

Setscheme
=>
However run-time errors occurring in many primitive functions will appear in a somewhat different form, usually with a short capitalised error message.
(define (test x) (+ x #f)
    )
(test 4)

Error: NUMBER(S) NEEDED
Culprits: #f, 0,
In file: /users/users3/fac/pop/poplocal/local/Scheme/errors.scm

Error Messages Emanating from UMASS Scheme

The following error messages are produced directly by the UMASS Scheme System. They may be proceeded by warnings from the Naomi Nag. Others may be produced by Poplog itself. Single capital letters are used in places in which a string will be substituted.

The "Report POP-11 functions" button

This is only of significance to system-maintainers. It should be left in the "inactive" position, that is the "up" or unshaded position.

This button switches the Scheme system into a mode suitable for system debugging, so it should normally be left inactive. Its effect is to cause errors to be reported by the POP-11 error reporting function, which doesn't format the error message by replacing '%p' occurring in an error message by a value, and which reports all functions on the call-stack, not just those defined in Scheme. For example, a call of

(car 1 2)
with the "Report POP-11 functions" button set produces:
;;; MISHAP - Calling function '%p' with wrong number (%p) of arguments, it needs %p
;;; INVOLVING:  'car' 2 1
;;; FILE     :  /users/users3/fac/pop/poplocal/local/Scheme/errors.scm   LINE NUMBER:  35
;;; DOING    :  mishap_GDB apply_checking exec_scm compile_Scheme schemecompile scheme_compile
     apply runproc charin read_sexpr compile_Scheme schemecompile scheme_compile pop_setpop_compiler

Type of error = Expression_RT

instead of

Error: Calling function 'car' with wrong number (2) of arguments, it needs 1
In file: /users/users3/fac/pop/poplocal/local/Scheme/errors.scm

Value = 2
This error report was prepared for Robin Popplestone
 by Jeremiah Jolt, your compile-time helper.

Where the error reporting could be improved.

The number of arguments that a user-defined function expects should be reported. The "value = " is probably not helpful.