Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!nosun!qiclab!m2xenix!puddle!p101.f4.n494.z5.fidonet.org!Pat.Terry From: Pat.Terry@p101.f4.n494.z5.fidonet.org (Pat Terry) Newsgroups: comp.lang.modula2 Subject: JPI M2 2.00 - PROCEDURE FUNCTIONS & ERROR CHECKING Message-ID: <2029.26AAA199@puddle.fidonet.org> Date: 23 Jul 90 04:37:31 GMT Sender: ufgate@puddle.fidonet.org (newsout1.26) Organization: FidoNet node 5:494/4.101 - Settler City Fido, Grahamstown RSA Lines: 40 > I would appreciate a response from each of you (whether you use JPI M2 > 2.00 or not) concerning the following question/dilema: > MODULE t; PROCEDURE f () : INTEGER; BEGIN END f; VAR a : INTEGER; BEGIN a := f() END t. JPI 1.17 - compile time error FST, Logitech 3.03, JPI 2.0, QuickMod, FTL - no compile time error QM and FTL did not even report run time error. While a preference would be for a compile time error, note that the presence of a RETURN does not mean you cannot switch off run time checking, unless you are very clever. For example, the code below would not execute the RETURN. MODULE t; PROCEDURE f () : INTEGER; BEGIN IF FALSE THEN RETURN 1 ELSE END END f; VAR a : INTEGER; BEGIN a := f() END t. -- uucp: uunet!m2xenix!puddle!5!494!4.101!Pat.Terry Internet: Pat.Terry@p101.f4.n494.z5.fidonet.org