Hello Elan,
I agree that in a garbage-collection world, destructors are mostly unneeded,
but then garbage collection must cover everything (ie. every resource).
Consider the following REBOL session - the port is not freed by the GC.
Quite anoying when experimenting.
Perhaps the GC is simply faulty, but othervice it'd be nice to be able to
encapsulate resource (de-)allocation in an object with a destructor...
## rebol/version
== 2.2.0.1.1
## recycle/on
## my-port: open tcp://:80
## my-port: none
== none
## my-port: open tcp://:80
** Access Error: Error opening socket listen port.
** Where: my-port: open tcp://:80
## recycle/torture
## my-port: open tcp://:80
** Access Error: Error opening socket listen port.
** Where: my-port: open tcp://:80
Best regards
Thomas Jensen
On 22-Feb-00, [EMAIL PROTECTED] wrote:
> Hi Martin,
>
> re: destructors:
>
> Note that REBOL has automatic garbage collection.
>
> This means that the memory that was allocated by an object programmatically
> during its creation processor or subsequently will be automatically
> released when the object is destroyed.
>
> In contrast, programming languages like C++ that do not have automatic
> garbage collection require a destructor function, so that you will be able
> to clean up, i.e. release programmatically allocated memory, when your
> object is destroyed.
>
> With automatic garbage collection, i.e. memory getting automatically
> reclaimed, I think the motivation behind a destructor function no longer
> exists and a destructor function is no longer critical.
>
>
> ;- Elan >> [: - )]
>
>