POV-Ray : Newsgroups : povray.off-topic : C++ questions : Re: C++ questions Server Time
7 Sep 2024 15:27:02 EDT (-0400)
  Re: C++ questions  
From: Orchid XP v8
Date: 26 Sep 2008 15:46:54
Message: <48dd3c2e$1@news.povray.org>
>> Yeah, but if the Haskell runtime has code to handle printing out a 
>> human-readable error message on an unhandled exception, why can't it 
>> also run some finalisers? This is pretty basic stuff!
> 
> Yep, true. I didn't realize you meant "exited cleanly due to an 
> unhandled exception." I thought you meant "crashed out due to a signal, 
> or running out of memory, or some such."
> 
> I suppose you could theoretically do a final GC and finalize before you 
> exited (but perhaps before you printed the exception stack?), but I 
> think at that point you're already pretty screwed. :-)

Basically, all you have to do is write a Haskell program that calls the 
"error" function somewhere, and your program will exit without closing 
anything behind it. Unless *you* remembered to take steps to prevent that.

That seems... a little unsafe to me.

Still, at least the code to do it isn't that hard.

   bracket
     (openFile "Foo.txt" ReadMode)
     (hClose)
     (\file_handle -> ...do stuff...)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

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