------ art_6_17392398.1323186164269 Content-Type: multipart/alternative; boundary --- art_7_21388250.1323186164269" ------ art_7_21388250.1323186164269 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Sunday, December 4, 2011 3:02:29 PM UTC-5, NARUSE, Yui wrote: > > > After some consideration, I'm wondering why following code is not used. > There is already a method or proc object in usual use case? > > begin > obj.__send__(callback, attributes) > rescue ArgumentError > obj.__send__(callback) > end > I avoid rescue clauses when I can because I am under the assumption that they will (almost) always be less efficient then a conditional check. ------ art_7_21388250.1323186164269 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit <br><br>On Sunday, December 4, 2011 3:02:29 PM UTC-5, NARUSE, Yui wrote:<blockquote class mail_quote" style argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><br><p>After some consideration, I'm wondering why following code is not used.<br>There is already a method or proc object in usual use case?</p><p>begin<br> obj.__send__(callback, attributes)<br>rescue ArgumentError<br> obj.__send__(callback)<br>end</p></blockquote><div><br></div><div>I avoid rescue clauses when I can because I am under the assumption that they will (almost) always be less efficient then a conditional check.</div><div><br></div><blockquote class mail_quote" style argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><p></p><p></p><p></p><p></p></blockquote> ------ art_7_21388250.1323186164269-- ------ art_6_17392398.1323186164269--