From: Mathieu Bouchard Date: 2006-07-24T05:03:53+09:00 Subject: Re: [YAY] my sandboxing extension!! --8323328-453379889-1153684976=:30944 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-453379889-1153684976=:30944" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-453379889-1153684976=:30944 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 24 Jul 2006, Nikolai Weibull wrote: > On 7/23/06, Mathieu Bouchard wrote: >> VALUE foo =3D rb_funcall((VALUE)3,rb_intern("<<"),INT2NUM(n)); > Yuck, that's really nasty Thank you! If you can't think of a better solution, don't call it nasty. A solution not running in O(n) can't be called better, and I can't think=20 of anything else in O(n), can you? The only way that direct modification of the result of << could hurt is if= =20 some Ruby of the future doesn't make it always return a new object=20 anymore. I can't see that happen any time soon. > (INT2FIX() is sufficient, though). If you mean vs INT2NUM, this hardly makes any difference. If you mean (VALUE)3, I don't know why I didn't write INT2NUM(1) or=20 INT2FIX(1) instead, but as it is, it doesn't make any difference either. _ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - t=E9l:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montr=E9al QC Canada --8323328-453379889-1153684976=:30944-- --8323328-453379889-1153684976=:30944--