On 14/07/2010, at 9:52 AM, David Parry wrote:

> On 13/07/2010, at 5:51 PM, Sean Seefried wrote:
>> A really cool refactor would be to make it dependent on Prototype OR jQuery.
> 
> Well, the only reason it depends on Prototype is for the Class/Inheritance 
> features of Prototype, so an even better refactor would be to reimplement it 
> in CoffeeScript...


CofeeScript doesn't do anything fancy in regards to classes, and it doesn't 
give you any inheritance.

The CoffeeScript:

class User
  name: -> "Tim"

is equivalent to:

User = function() {}
User.prototype.name = function() { return "Tim" }

-- tim

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to