Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ru-cs44.UUCP Path: utzoo!watmath!clyde!akgua!mcnc!decvax!harpo!ihnp4!houxm!hogpc!houti!ariel!vax135!ukc!ru-cs44!adrian From: adrian@ru-cs44.UUCP Newsgroups: net.lang.mod2 Subject: Re: circular procedure types Message-ID: <670@ru-cs44.UUCP> Date: Sat, 19-May-84 06:49:21 EDT Article-I.D.: ru-cs44.670 Posted: Sat May 19 06:49:21 1984 Date-Received: Mon, 14-May-84 01:09:31 EDT References: <840@unm-cvax.UUCP> Organization: Reading Univ. UK. Lines: 33 Our compiler (M2UNIX for the PDP-11) doesn't allow this program, complaining as follows: 1 MODULE circproc; 2 3 TYPE Circular = PROCEDURE(Circular, CARDINAL): CARDINAL; **** ^74: type not declared 4 5 PROCEDURE a(b: Circular; x: CARDINAL): CARDINAL; 6 BEGIN 7 IF x = 0 THEN 8 RETURN 1 9 ELSE 10 RETURN x * b(b, x - 1) 11 END 12 END a; 13 14 PROCEDURE Factorial(n: CARDINAL): CARDINAL; 15 BEGIN 16 RETURN a(a, n) **** ^128: type incompatibility 17 END Factorial; 18 19 END circproc. I guess you could do it with two procedures and two definition modules but ... -- Adrian Pell ({vax135,mcvax,edcaad}!ukc!ru-cs44!adrian) Computer Science Dept. University of Reading UK