Re: [jruby-dev] Singleton object with instance_exec

2012-07-08 Thread Maksym Parkachov
Hi guys, thanks for all suggestions. >> myLongListNameIDontWantToRepeat.tap do |l| >> l.psize >> l.add 10 >> l.psize >> ... >> end > > I was going to suggest #tap myself, but I realized it's not as "bare" > as instance_eval/exec. Yep, the instance_exec version is bit better, but I think

Re: [jruby-dev] Singleton object with instance_exec

2012-07-07 Thread Charles Oliver Nutter
On Fri, Jul 6, 2012 at 12:17 PM, Rodrigo Rosenfeld Rosas wrote: > myLongListNameIDontWantToRepeat.tap do |l| > l.psize > l.add 10 > l.psize > ... > end I was going to suggest #tap myself, but I realized it's not as "bare" as instance_eval/exec. It is certainly unfortunate that instance_ev

Re: [jruby-dev] Singleton object with instance_exec

2012-07-06 Thread Rodrigo Rosenfeld Rosas
Em 06-07-2012 10:48, Maksym Parkachov escreveu: Hi developers, I'm trying version 1.7 preview, which works great and fast btw., and becoming a lot of warning concerning singleton on non-persistent Java type. The pattern, I'm using: require 'java' java_import java.util.ArrayList class ArrayLi

Re: [jruby-dev] Singleton object with instance_exec

2012-07-06 Thread Charles Oliver Nutter
On Fri, Jul 6, 2012 at 8:48 AM, Maksym Parkachov wrote: > I'm trying version 1.7 preview, which works great and fast btw.,  and > becoming a lot of warning concerning singleton on non-persistent Java > type. > > The pattern, I'm using: > > require 'java' > java_import java.util.ArrayList > > class