[plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Sat Feb 7 14:50:11 EST 2009

On Sat, Feb 7, 2009 at 2:42 PM, YC <yinso.chen at gmail.com> wrote:
> On Sat, Feb 7, 2009 at 10:46 AM, Matthias Felleisen <matthias at ccs.neu.edu> wrote:
>>
>> And struct provides basic inheritance, so what's missing is polymorphism,
>> but that's possible to achieve if the struct themselves carry the functions
>> that they need to call. Also I miss the destructor and explicit finalize.
>> Those comes in very handy for external resource management.
>>
>> GC.
>
> I am probably missing the point here, but I think GC doesn't help with
> closing file handles or database connections (at least *safely*), no?
>
> Thanks,
> yc

The PLT Scheme garbage collector does close file handles.  A database
library certainly could, and should, use the garbage collector to
close connections.  I don't know which ones do, but that's only my own
inexperience with Scheme database libraries.  In both cases, GC
doesn't preclude the option to manually close a connection earlier --
but GC makes that into an optimization rather than a necessity, for
most purposes.

-- 
Carl Eastlund


Posted on the users mailing list.