[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ruby philosophy vs Lua philosophy
- From: Steve Litt <slitt@...>
- Date: Sun, 24 Feb 2013 19:29:04 -0500
On Sun, 24 Feb 2013 18:59:13 +0100
Ico <lua@zevv.nl> wrote:
> By no means ment as Ruby-bashing, but an (imho) interesting
> observation: one of the new core features of Ruby 2.0 is the
> following syntactic sugar for generating lists of symbols:
>
> # Ruby 1.9:
> KEYS = [:foo, :bar, :baz]
>
> # Ruby 2.0:
> KEYS = %i[foo bar baz]
>
> Funny, but I can't imagine this type of 'new language features' ever
> ending up in Lua. Thank you for keeping my favourite language small
> and tidy :)
Quoted for Truth!!!
I wouldn't call that syntactic sugar so much as syntactic molassas.
I learned Ruby first, but I never understood iterators until learning
Lua, because Ruby's iterator syntax is so magical, black boxy, and
removed from its function.
SteveT