Pref::typeCheck
-- type
checking of formal parametersPref::typeCheck
determines the kind of type checking of
procedure parameters.
Pref::typeCheck(value)
Pref::typeCheck( <NIL>)
value |
- | one of Always , Interactive ,
None , or NIL |
the last defined value
args
, DOM_PROC
, domtype
, hastype
, proc
, testargs
, testtype
, Type
, type
Type
can be used. With Type
, user defined types can be easily
added to the system to extend the type checking mechanism.Pref::typeCheck
can be:
None
Interactive
Always
Interactive
means: When the user is
calling a procedure f
, their parameters will be checked,
but all procedures, that will be called by the user called procedure
f
, performs no type checking.Pref::typeCheck
without arguments returns
the current value. The argument NIL
resets the default
value, which is Interactive
.The parameters of the procedure f
must be
an identifier followed by an integer:
>> f:= proc(a : DOM_IDENT, b : DOM_INT) begin evalassign(a, b) end_proc: f(a, 2)
2
Now a
has the value 2
, but an
identifier is expected:
>> f(a, a + 2)
Error: Wrong type of 2. argument (type 'DOM_INT' expected, got argument 'a + 2'); during evaluation of 'f'
proc(a : DOM_IDENT, b : Type::Integer)
.
That means: a
must be of the type DOM_IDENT
and b
must be of the type Type::Integer
.Type
covers generally more objects as the MuPAD kernel types.