Article View: comp.lang.modula2
Article #4809Re: Recursive data types
From: Mark William Lind I
Date: Tue, 09 May 1989 08:04
Date: Tue, 09 May 1989 08:04
41 lines
1920 bytes
1920 bytes
kloppen@gmdzi.UUCP (Jelske Kloppenburg) writes:
:ugprussa@cs.Buffalo.EDU (Michal Prussak) writes:
:> Wirth describes in his book "Algorithms and Data Structures" (from 1986)
:> a recursive data type (p 173):
^^^^^^^^^ ^^^^ ^^^^
RECURSIVE DATA TYPE ???
:> TYPE
:> ped = RECORD
:> CASE known: BOOLEAN OF
:> TRUE: name: ARRAY[1..10] OF CHAR |
:> FALSE: father, mother: ped; <--- recursive fields
:> END (* case *); ^^^^^^^^^
:> END (* record *);
:
:That can not work...
DYNAMIC MEMORY ALLOCATION (not recursive)
:TYPE
: LinkPTR = POINTER TO Link;
: Link = RECORD
: Text: String;
: Count: CARDINAL;
: Left, Right: LinkPTR
: END;
This is dynamic memory allocation... but this is not a RECURSIVE
data type. Personally, I don't see what the use of a recursive
data structure is. Dynamic memory allocation is of obvious
worth (no pun intended), but I don't see what the hell you would
do with a recursive boolean expression?....... huh?
Please Explain if you are still there.
Hmmm...
--
+-------------------------------------------------------------------------+
\ Mark William Lind I \ mlind@polyslo.CalPoly.EDU \ Mark L \ 8^" \
\ Std Disclaimer Assumed \ "Evel Knievel, you got nothin' on me." -_R_a_e_l \
+-------------------------------------------------------------------------+
Technical Details
Message-ID:
<11188@polyslo.CalPoly.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!polyslo!mlindReferences:
<5734@cs.Buffalo.EDU: <1046@gmdzi.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!polyslo!mlind From: mlind@polyslo.CalPoly.EDU (Mark William Lind I) Newsgroups: comp.lang.modula2 Subject: Re: Recursive data types Summary: hmmmmmm.... Message-ID: <11188@polyslo.CalPoly.EDU> Date: 9 May 89 08:04:36 GMT References: <5734@cs.Buffalo.EDU: <1046@gmdzi.UUCP> Reply-To: mlind@polyslo.CalPoly.EDU (Mark William Lind I) Organization: Poly C.A.T.S. Lines: 41