From: Sean O'Dell Date: 2003-10-03T01:08:09+09:00 Subject: Re: C or C++? Thomas Sondergaard wrote: >>Ruby is really C-oriented. It longjmps on errors, so the stack doesn't >>"unwind" the way C++ objects really wants it to. > > > I think I understand what you mean. Is it that destructors may not be called > as expected? Please elaborate! Destructors don't get called, correct. >> There are work-arounds >>for that, but I found that without a good foundation of libraries to >>work with, C++ was a real pain, so I stick with C. > > What kind of work arounds? If you rb_protect everything the longjmp's should > only happen in ruby-land, and you should be safe in C++, right? I believe, at least under Windows, that rb_protect didn't protect me quite as well as I needed (I still got longjmp'd past), so I abandonded C++ entirely. I'm a devoted C++ user, so I didn't give it up easily, believe me. It was just FAR more trouble trying to be Mr. C++ around the Ruby engine than it was using C. C isn't so bad if you got your head on for it. Sean O'Dell