Richard Maine wrote:
> Toon Moene writes:
> > Richard Maine wrote:
> [linked lists need pointers]
> > Huh? - Perhaps I do not understand "linked lists" ? :-)
> > TYPE LINKEDLIST
> > TYPE (LINKEDLIST), ALLOCATABLE :: NEXT
> > TYPE CONTENT
> > blah ... blah ... blah
> > END TYPE CONTENT
> > END TYPE LINKEDLIST
> ...
> Well, you *CAN* do it that way. But would you want to?
> You left out all the "fun" parts. Try now doing an insertion
> or deletion in the middle of such a list (or at the beginning
> for that matter). Yes, its possible. But you end up copying
> the whole list (or anyway the part of it after the insertion).
GRRR, yes, you're right. As long as building up the structure (being it
a linked list, a tree, or something more complicated) - and just
traversing that or running down its branches - is involved, ALLOCATABLE
would suffice. However, once one wants to reconstruct (or demolish)
said constructs, pointers are inevitable.
Bweh,
--
Toon Moene - mailto:[log in to unmask] - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|