Live data from Hacker News

R.I.P. Ruby Hash Rocket Syntax 1993-2010

blog.peepcode.com

91–95 of 95 posts

Re: R.I.P. Ruby Hash Rocket Syntax 1993-2010

#91
post #11
post #5

also says this syntax is compatible with python which is not really true. if you have this in python: { key: "value", dr_nic: "The Comedian", ttl: 42 } python will expect there to be a variable called 'key', one called 'dr_nic', and one called 'ttl'. If you intend to do d['ttl'] you'll need to create a hash using a literal string

You don't necessarily have to create a hash using a literal string. You can also do this: dict( key="value", dr_nic="The Comedian", ttl=42 ) ...but that is a bit different syntax.

Yeah.

I always do in such way. And I will continue even if it's a bit slower =)

Re: R.I.P. Ruby Hash Rocket Syntax 1993-2010

#92
post #90
post #89

Earlier quoted context omitted.

Well, the pun was not about the => operator, but about Ruby becoming "less parseable". As they say: "Only perl can parse Perl" ;-) So => is the "hashrocket" operator? I can't find any reference to this name besides this: http://www.ruby-forum.com/topic/152544

I suppose. It goes well with the spaceship operator .

Now we need to find a meaning for |=| so it can be the Tie Fighter operator.

Re: R.I.P. Ruby Hash Rocket Syntax 1993-2010

#93

Now if only you could change list.sorting = {:name => 'ASC'} to list.sorting = {:name: 'ASC'}

I'm not familiar with the particular 'sorting' thing you're doing, but if the first things works, then the second should work in 1.9 if you use the correct syntax -- you have an extra colon. It should be: list.sorting = {name: 'ASC'}

Re: R.I.P. Ruby Hash Rocket Syntax 1993-2010

#94
post #75
post #69

Earlier quoted context omitted.

On the contrary, I wish javascript had more Rubyisms. Don't you get sick of typing function(){..} when just {..} would do?

It sounds like you'd love CoffeeScript

I would love it if it the browser could run it natively. But if we're replacing browser language, can I just have plain Ruby?

Re: R.I.P. Ruby Hash Rocket Syntax 1993-2010

#95
post #70

This is one of the more upvoted Ruby stories I've seen on HN in some time, and it's a little bit disappointing. Sensationalism and inaccuracy are all it takes these days, eh?

I'm hoping that the story is upvoted more for the artistry of the post, The Watchmen reference and the plead to move to 1.9 and less for the argument of hashrocket vs. colon syntax.

But, given the chance HN will always fan the flames of the argument that lies within.

Post reply on HN