Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site hcrvax.UUCP Path: utzoo!hcrvax!hugh From: hugh@hcrvax.UUCP (Hugh Redelmeier) Newsgroups: net.lang.c Subject: Re: casts and puns (and digressions...) Message-ID: <1486@hcrvax.UUCP> Date: Tue, 13-Nov-84 13:27:54 EST Article-I.D.: hcrvax.1486 Posted: Tue Nov 13 13:27:54 1984 Date-Received: Wed, 14-Nov-84 02:25:38 EST References: <110@ISM780B.UUCP> <940@opus.UUCP> Organization: Human Computing Resources, Toronto Lines: 13 > > >Also, Pascal, which is doubtlessly a strongly typed language, does > > >permit a type definition like 'type ref= ^ref;' and handles it > > >correctly... > Perhaps true, but marginally relevant to reality, since the only value > assignable to an object of type ref is NIL. This turns out not to be the case. Type ref is a suitable representation for integers. If you remember Peano, here are some implementations: constant zero = nil; function successor(n: ref): ref; begin new(successor); successor^ := n end; function predecessor(n: ref): ref; begin predecessor := n^ end