POV-Ray : Newsgroups : povray.advanced-users : the POV-ray SDL--similar to Java and/or Python? : Re: the POV-ray SDL--similar to Java and/or Python? Server Time
6 Oct 2024 22:16:29 EDT (-0400)
  Re: the POV-ray SDL--similar to Java and/or Python?  
From: Warp
Date: 13 Sep 2006 11:10:40
Message: <45081f70@news.povray.org>
Orchid XP v3 <voi### [at] devnull> wrote:
> OK, well how would you build (say) a linked list structure if the new 
> node goes out of scope as soon as you get to the end of the function 
> that creates it and adds it to the list?

  It goes out of scope, but it has two references pointing to it
(one in the function and another in the list data structure). When
it goes out of scope in the function that simply decreases the
reference count by one.

> OK, how about a double-linked list?

> Every node (except the end ones) always has 2 other nodes pointing to 
> it. Hence the reference count will never reach zero. QED.

  The nodes at the ends of the list have only one.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.