REDUCE

12.6 Some Convenient Error Calls

The following functions may be useful in user packages:

(rangeerror OBJECT:any INDEX:integer FN:function):
None expr
(stderror
(bldmsg "Index %r out of range for %p in %p" INDEX OBJECT FN))

(stderror MESSAGE:string): None Returned expr
(error 99 message)

(typeerror OFFENDER:any FN:function TYP:any):
None Returned expr
(stderror (bldmsg
"An attempt was made to do %p on %r, which is not %w"
FN OFFENDER TYP))

(usagetypeerror OFF:any FN:function TYP:any USAGE:any):
None Returned expr
(stderror (bldmsg
"An attempt was made to use %r as %w in %p, where %w is needed"OFFENDER USAGE FN TYP))

(nonwordserror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "a words vector")

(nonpairerror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "a pair")

(nonlisterror OFFENDER:any FN:function):
None Returned expr
(typeerror OFFENDER FN "a list or NIL")

(noniderror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "an identifier")

(nonnumbererror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "a number")

(nonintegererror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "an integer")

(nonpositiveintegererror OFFENDER:any FN:function): None expr
(typeerror OFFENDER FN "a non-negative integer")

(noncharactererror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "a character")

(nonstringerror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "a string")

(nonvectorerror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "a vector")

(nonwordserror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "a words vector")

(nonsequenceerror OFFENDER:any FN:function): None Returned expr
(typeerror OFFENDER FN "a sequence")