Thibaut Barrère
2010-Feb-01 09:03 UTC
[Ironruby-core] IronRuby idiom for using (IDisposable) ?
Hello, Is there a built-in way to achieve what C# ''using'' does, with IronRuby ? Although it''s pretty easy to roll your own ( http://myotherpants.com/2009/09/disposable-code), I''d like to use the built-in way if there''s one. thanks! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100201/96fb9e55/attachment.html>
Ivan Porto Carrero
2010-Feb-01 09:07 UTC
[Ironruby-core] IronRuby idiom for using (IDisposable) ?
yes http://github.com/casualjim/ironnails/blob/master/IronNails/vendor/iron_nails/lib/core_ext/kernel.rb#L17 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Feb 1, 2010 at 10:03 AM, Thibaut Barr?re <thibaut.barrere at gmail.com>wrote:> Hello, > > Is there a built-in way to achieve what C# ''using'' does, with IronRuby ? > > Although it''s pretty easy to roll your own ( > http://myotherpants.com/2009/09/disposable-code), I''d like to use the > built-in way if there''s one. > > thanks! > > -- Thibaut > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100201/386f26a5/attachment.html>
Ivan Porto Carrero
2010-Feb-01 09:08 UTC
[Ironruby-core] IronRuby idiom for using (IDisposable) ?
you don''t need to provide the true anymore. It was a bug a year ago and I still have to update that --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Feb 1, 2010 at 10:07 AM, Ivan Porto Carrero < ivan at whiterabbitconsulting.eu> wrote:> yes > > > http://github.com/casualjim/ironnails/blob/master/IronNails/vendor/iron_nails/lib/core_ext/kernel.rb#L17 > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > > > > On Mon, Feb 1, 2010 at 10:03 AM, Thibaut Barr?re < > thibaut.barrere at gmail.com> wrote: > >> Hello, >> >> Is there a built-in way to achieve what C# ''using'' does, with IronRuby ? >> >> Although it''s pretty easy to roll your own ( >> http://myotherpants.com/2009/09/disposable-code), I''d like to use the >> built-in way if there''s one. >> >> thanks! >> >> -- Thibaut >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100201/c57eada5/attachment.html>
Thibaut Barrère
2010-Feb-01 09:21 UTC
[Ironruby-core] IronRuby idiom for using (IDisposable) ?
Thanks Ivan, I like your version :) Will something similar be added directly into IronRuby Kernel ? -- Thibaut On Mon, Feb 1, 2010 at 10:07 AM, Ivan Porto Carrero < ivan at whiterabbitconsulting.eu> wrote:> yes > > > http://github.com/casualjim/ironnails/blob/master/IronNails/vendor/iron_nails/lib/core_ext/kernel.rb#L17 > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > > > > On Mon, Feb 1, 2010 at 10:03 AM, Thibaut Barr?re < > thibaut.barrere at gmail.com> wrote: > >> Hello, >> >> Is there a built-in way to achieve what C# ''using'' does, with IronRuby ? >> >> Although it''s pretty easy to roll your own ( >> http://myotherpants.com/2009/09/disposable-code), I''d like to use the >> built-in way if there''s one. >> >> thanks! >> >> -- Thibaut >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100201/fa9d7c7e/attachment.html>
Ivan Porto Carrero
2010-Feb-01 09:35 UTC
[Ironruby-core] IronRuby idiom for using (IDisposable) ?
it''s not a rubyism as such, so I don''t think it actually belongs in the core. But opinions may vary --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Feb 1, 2010 at 10:21 AM, Thibaut Barr?re <thibaut.barrere at gmail.com>wrote:> Thanks Ivan, > > I like your version :) > > Will something similar be added directly into IronRuby Kernel ? > > -- Thibaut > > On Mon, Feb 1, 2010 at 10:07 AM, Ivan Porto Carrero < > ivan at whiterabbitconsulting.eu> wrote: > >> yes >> >> >> http://github.com/casualjim/ironnails/blob/master/IronNails/vendor/iron_nails/lib/core_ext/kernel.rb#L17 >> --- >> Met vriendelijke groeten - Best regards - Salutations >> Ivan Porto Carrero >> Blog: http://flanders.co.nz >> Twitter: http://twitter.com/casualjim >> Author of IronRuby in Action (http://manning.com/carrero) >> >> >> >> On Mon, Feb 1, 2010 at 10:03 AM, Thibaut Barr?re < >> thibaut.barrere at gmail.com> wrote: >> >>> Hello, >>> >>> Is there a built-in way to achieve what C# ''using'' does, with IronRuby ? >>> >>> Although it''s pretty easy to roll your own ( >>> http://myotherpants.com/2009/09/disposable-code), I''d like to use the >>> built-in way if there''s one. >>> >>> thanks! >>> >>> -- Thibaut >>> >>> _______________________________________________ >>> Ironruby-core mailing list >>> Ironruby-core at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/ironruby-core >>> >>> >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100201/511c2eda/attachment.html>
Thibaut Barrère
2010-Feb-01 09:46 UTC
[Ironruby-core] IronRuby idiom for using (IDisposable) ?
> it''s not a rubyism as such, so I don''t think it actually belongs in thecore. But opinions may vary agreed - it''s an ironrubyism :) I think we can add it straight to the FAQ, to the very least! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100201/212e7821/attachment-0001.html>
Daniele Alessandri
2010-Feb-01 10:09 UTC
[Ironruby-core] IronRuby idiom for using (IDisposable) ?
On Mon, Feb 1, 2010 at 10:46, Thibaut Barr?re <thibaut.barrere at gmail.com> wrote:>> it''s not a rubyism as such, so I don''t think it actually belongs in the >> core. But opinions may vary > > agreed - it''s an ironrubyism :)I''m definitely against adding such a feature to the core (as Ivan said, it doesn''t belong to ruby), but... require ''ironrubysm'' # just to reuse your term, but it could be something along these lines :-) Maybe we can have a separate gem that groups a bunch of typical .NET patterns in a more rubyish way. Thoughts? -- Daniele Alessandri http://www.clorophilla.net/ http://twitter.com/JoL1hAHN
Thibaut Barrère
2010-Feb-01 10:17 UTC
[Ironruby-core] IronRuby idiom for using (IDisposable) ?
> Maybe we can have a separate gem that groups a bunch of typical .NET > patterns in a more rubyish way. Thoughts?I think it''s a nice idea; it would be a bit like Facets ( http://facets.rubyforge.org/), small bits that you can enable if you wish. -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100201/99bffda4/attachment.html>
Orion Edwards
2010-Feb-01 19:44 UTC
[Ironruby-core] IronRuby idiom for using (IDisposable) ?
I also think it''s a nice idea. I have a few other such methods (Array#to_clr_a, Time#to_clr_time, and the godawful Array#to_2d_a) that seem like they''d also be a good fit :-) On Mon, Feb 1, 2010 at 11:17 PM, Thibaut Barr?re <thibaut.barrere at gmail.com>wrote:> > Maybe we can have a separate gem that groups a bunch of typical .NET > > patterns in a more rubyish way. Thoughts? > > I think it''s a nice idea; it would be a bit like Facets ( > http://facets.rubyforge.org/), small bits that you can enable if you wish. > > -- Thibaut > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100202/ed5825aa/attachment.html>