Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!uw-beaver!cornell!rochester!PT.CS.CMU.EDU!sei!sei.cmu.edu!firth From: firth@sei.cmu.edu (Robert Firth) Newsgroups: comp.lang.modula2 Subject: Re: Recursion & Types Keywords: Cell-as-data Message-ID: <4209@aw.sei.cmu.edu> Date: 15 Feb 88 13:52:43 GMT References: <4572@uwmcsd1.UUCP> Sender: netnews@sei.cmu.edu Reply-To: firth@bd.sei.cmu.edu.UUCP (Robert Firth) Organization: Carnegie-Mellon University, SEI, Pgh, Pa Lines: 24 In article <4572@uwmcsd1.UUCP> markh@csd4.milw.wisc.edu (Mark William Hopkins) writes: >I guess this gets me to my next question, somewhat related: > > If Modula-2 goes so far as to include Procedure as a data type, > then why not memory cell? > > One can imagine a type Cell internally defined as an array of W bits > ... But Modula-2 DOES include this feature, in a manner pretty close to what you'd like. Check out PIM2 #rd Edition, Chapter 12, on System-dependent facilities. You'll find types WORD and ADDRESS. You can convert a WORD into a set (former Modula-2 BITSET) and munge the bits. You can generate the address of any cell by ADR. And so on. There are also rules for formal/actual parameter compatibility that allow you to evade the typing mechanism by using WORD, ADDRESS, and open arrays. It's all good stuff!