[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ruby philosophy vs Lua philosophy
- From: William Sumner <prestonsumner@...>
- Date: Sun, 24 Feb 2013 13:25:23 -0700
On Feb 24, 2013, at 10:59 AM, 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 :)
That sounds like it was meant to be Ruby-bashing. :) The %i literal syntax falls in line with the existing %w syntax for creating an array of strings. Lua has its own syntactic sugars, so what constitutes small and tidy can be pretty subjective, really. Every language has its reasons for being the way it is.
Preston