Path: news.daimi.aau.dk!news.uni-c.dk!uninett.no!sn.no!hermod.uio.no!ifi.uio.no!not-for-mail From: Alf-Ivar Holm Newsgroups: comp.lang.beta Subject: Mantatory argument Date: 11 Jun 1997 08:24:22 +0200 Organization: The Department of Informatics, University of Oslo, Norway Lines: 35 Sender: alfh@byleist.ifi.uio.no Message-ID: NNTP-Posting-Host: byleist.ifi.uio.no X-Newsreader: Gnus v5.4.56/Emacs 19.34 Xref: news.daimi.aau.dk comp.lang.beta:11142 I have a library with some functions. These functions does only provide something useful if given an argument. If I, by mistake, don't assign any values to these functions, the program continues, but the value(s) produces by the functions may break something else later on. Two problems: 1) The error is not catched where it occurred, and 2) The error is not found before run-time. Problem 1) may by fixed by adding something extra to each function that give a warning or error at runtime if the functions are not called with an argument. Something like: myFunc: (# in, out: @integer; entered: @boolean; enter (# enter in do true->entered #) do (if not(entered) then notification(# ... #) else ... if); exit out #); This is still no remedy for problem 2). I have to wait for the erroneous statement to occur run-time. What I would like were some kind of construct that would let me say that some patterns must be assigned values. It may be a bit non-Beta-ish to prevent patterns from being used as any evaluation type. OTOH, Beta does catch a lot of errors compile-time, and this seems to be another case where it would not be too hard for the compiler to find the error, given some indication that the pattern must evaluate it's enter part. Is it only me who would like this? Have I missed something? Affi