Previous Page Next Page Contents

Pref::typeCheck -- type checking of formal parameters

Introduction

Pref::typeCheck determines the kind of type checking of procedure parameters.

Call(s)

Pref::typeCheck(value)
Pref::typeCheck( <NIL>)

Parameters

value - one of Always, Interactive, None, or NIL

Returns

the last defined value

Related Functions

args, DOM_PROC, domtype, hastype, proc, testargs, testtype, Type, type

Details

Example 1

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'

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000