From: Matt Sergeant Date: 2001-03-30T01:10:09+09:00 Subject: [ruby-talk:13329] Re: hash slice implementaion Conrad Schneiker wrote: > > Dave Thomas writes: > > # matz@zetabits.com (Yukihiro Matsumoto) writes: > # > # > |I'd like to use Perl's hash slice feature in Ruby. > # > |Here is my implemetation of hash slice. > # > |How about this code? > # > > # > It's interesting. The only reason hash#[] does not accept multiple > # > argument for slice is consistency with array, which uses [] argument > # > differently. If consensus is made, I'd like to merge it. But I > # > doubt. > # > # Given that we've got Hash#indices (OK, not the best of names, > # admittedly), and given that we've got parallel assignment, I think > # I'd personally vote of consistency over Perl compatibility in this > # case. > > For future reference, does anyone have a (good, clever, obvious) > recommendation to (past, present, future) Perl converts for how they > should handle this in idiomatic Ruby? array#slice() and array#slice()= -- /|| ** Founder and CTO ** ** http://axkit.com/ ** //|| ** AxKit.com Ltd ** ** XML Application Serving ** // || ** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** mod_perl news and resources: http://take23.org ** \\// //\\ // \\