From: Alex Young Date: 2011-12-05T20:11:50+09:00 Subject: [ruby-core:41491] Re: [ruby-trunk - Feature #5695][Open] CoffeeScript "is" and "isnt" keywords On 01/12/11 18:52, Suraj Kurapati wrote: > > Issue #5695 has been reported by Suraj Kurapati. > > ---------------------------------------- > Feature #5695: CoffeeScript "is" and "isnt" keywords > http://redmine.ruby-lang.org/issues/5695 > > Author: Suraj Kurapati > Status: Open > Priority: Normal > Assignee: > Category: > Target version: > > > Hello, > > Please add "is" and "isnt" keywords, which behave like the "==" and "!=" operators respectively, to Ruby. These keywords come from the CoffeeScript language. They are useful to prevent accidental assignment (forgetting a "=" in "==") and they preserve reading order, unlike inverted "if 5 == x" expressions known as "Yoda conditionals". Wouldn't it make more sense to have "is" use "==="? Then you could say, for instance, "if x is Numeric". "is" could then be syntax sugar for "case...when", and "isnt" could be implemented as the corresponding "else". -- Alex