Article View: comp.lang.modula2
Article #4806Recursive data types
From: Michal Prussak
Date: Sun, 07 May 1989 19:39
Date: Sun, 07 May 1989 19:39
28 lines
1246 bytes
1246 bytes
Wirth describes in his book "Algorithms and Data Structures" (from 1986)
a recursive data type (p 173):
TYPE
ped = RECORD
CASE known: BOOLEAN OF
TRUE: name: ARRAY[1..10] OF CHAR |
FALSE: father, mother: ped; <--- recursive fields
END (* case *);
END (* record *);
He remarks that CASE construction must be used because IF is not available
in Modula. I would therefore think that it should be legal. I can imagine
it would be very difficult to compile, and not surprisingly none of the
compilers i have access to does not allow this (one of them is LOGITECH
from Frankfurt University).
Does anybody know of a compiler that implements this? Or is this example
for future versions of Modula?
Michal Prussak
ugprussa@sunybcs.bitnet
ugprussa@cs.buffalo.edu
ugprussa@sunybcs.uucp
Technical Details
Message-ID:
<5734@cs.Buffalo.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!sunybcs!ugprussaShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!sunybcs!ugprussa From: ugprussa@cs.Buffalo.EDU (Michal Prussak) Newsgroups: comp.lang.modula2 Subject: Recursive data types Message-ID: <5734@cs.Buffalo.EDU> Date: 7 May 89 19:39:06 GMT Sender: nobody@cs.Buffalo.EDU Reply-To: ugprussa@cs.Buffalo.EDU (Michal Prussak) Organization: SUNY/Buffalo Computer Science Lines: 28