News for hackers. Stuff that matters.
Re:Contracts For CoffeeScript by chc on Tuesday August 30, 2011 @12:52AM (#2940163)
CoffeeScript does allow ! for negation, but contracts have their own syntax and semantics separate from the rest of the language. It's a little confusing initially, but I suppose there aren't a lot of good operators left. There are a lot of similar convenient inconsistencies that people hardly notice once they sink in:

• Indentation shifts mean different things depending on context (could mean we're doing an object literal, could mean we're defining a function, could mean we're entering a loop, etc.)

• Looping through arrays uses "in" while looping through everything else uses "of"

• Array and object literal syntax might create arrays and objects or define variables depending on which side of the equals sign you're reading

There are no comments on this comment yet.