From: Monty Taylor Date: March 22 2007 6:04pm Subject: Re: exceptions and perl List-Archive: http://lists.mysql.com/ndb-connectors/21 Message-Id: <1174586651.29239.5.camel@qualinost> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2007-03-22 at 10:52 +0200, Mika Raento wrote: > If we only use one mechanism, I'd strongly prefer exceptions over return > values. You can do RAII in perl, if you want, so it all fits together > quite nicely. Ok, cool. It's been a long time since I've done large scale Perl development, so I didn't feel adequate to make that call. Exceptions it is. I'll go ahead and push the Perl-uses-exceptions patch then. Well, after I've had some coffee, that is. > If we feel we have enough time I would very much like to see a way to > call functions that can be expected to fail with a parameter or a second > name which indicates that I'd like a return value instead of an > exception (a bit like open() in unix where you can say O_CREAT to create > the file if it doesn't exist or leave it out if you actually care > whether it existed or not). I like this idea. Might have to do some crazy typemaps to do this without manually adding an second function for every function - but I think it's certainly worthwhile to try! -- Monty Taylor, Senior Consultant MySQL Inc., Seattle, USA, www.mysql.com Cell: +1 972 979 5079 VOIP: 6677 Office: +1 408 213 6677 Are you MySQL certified? www.mysql.com/certification