From: Dave Aronson Date: 2012-02-07T04:04:32+09:00 Subject: Re: Using _ like in Scala? On Mon, Feb 6, 2012 at 13:54, Marc Heiler wrote: > I was told that scala uses _ to denote as default block argument (the > first one. I am not sure what else scala does) Lots of things... some of which we want to do, some not. Let's not go down the Perlish path of relying on obscure syntax just to save a few keystrokes... saving half a second for the writer, by wasting anywhere from seconds to hours for each future reader. > I am wondering whether Ruby could > reserve a set of key-names for variables. > > In this example it could use _ but it could perhaps make better use of > it too. Perhaps even something like: > > array_fruits = %w( apple banana orange ) > > ^^^ And the above would keep the variable permanently as array type. > (With the convention being that the leading name array_ would indicate > that) While those of us who came mostly from statically typed languages might find that comforting, it would be all too easy to abuse, and would change the fundamental nature of Ruby. Learn to love duck typing. (I've always wondered how ducks could type so well with wings, and webbed feet....) -Dave -- Dave Aronson:  Available Cleared Ruby on Rails Freelancer (NoVa/DC/Remote) -- see www.DaveAronson.com, and blogs at www.Codosaur.us, www.Dare2XL.com, www.RecruitingRants.com