<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Michael Latta wrote:
<blockquote cite="midAA2E4032-C855-11D8-8682-000A95676CE2@mac.com"
type="cite">
<pre wrap="">On Jun 27, 2004, at 8:57 AM, Ian Woollard wrote:</pre>
<blockquote type="cite">
<pre wrap="">And the file may be automagically closed as f goes out of scope.
But this is unreliable in Java/Self/Smalltalk- you don't know when the
GC will get around to release it. I consider this to be a bug in these
languages.
</pre>
</blockquote>
<pre wrap=""><!---->
This is inly an issue if you rely on the garbage collector to close
files (which most experienced programmers do not).</pre>
</blockquote>
No, no. You should not assume that because that feature involves
running the destructor in C++ - that the garbage collector should be
involved.<br>
<br>
My point is that a relatively trivial change to the language gets this
capability without involving the GC at all.<br>
<blockquote cite="midAA2E4032-C855-11D8-8682-000A95676CE2@mac.com"
type="cite">
<pre wrap="">In any event this is not a language issue,
but a library issue.
</pre>
</blockquote>
No. This problem cannot be solved in libraries- only by having a
diligent programmer call the close function in all cases at the right
time. I prefer for the language specification to permit the libraries
to guarantee that this be done automatically.<br>
<br>
Is this extra complexity in the language? Yes.<br>
<br>
</body>
</html>