You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 19, 2018. It is now read-only.
CoffeeScript classes already have support for static methods, via @methodName syntax:
classMaths@square: (x) -> x * x
Assuming we implement getters and setters, and assuming their syntax looks something like this:
classSquareextendsRectanglegetperimeter:->@side*4setarea: (x) ->@side=Math.sqrt x
Then I think we should also support the static keyword, for consistency:
classMathsstaticsquare: (x) -> x * x
Please keep discussion of get and set over in #17. If we decide not to implement get and set, or if we implement them in some syntax unlike what’s here, then we don’t need the static keyword. I propose we add the static keyword only if we add get and set keywords. We would also keep the @methodName syntax, for backward compatibility.
The text was updated successfully, but these errors were encountered:
I actually would like to avoid adding an alternate keyword for this. I think current way of dealing with it is consistent with the language. I can see some confusion around this, but for the most part that falls back to adding to the documentation.
CoffeeScript classes already have support for static methods, via
@methodName
syntax:Assuming we implement getters and setters, and assuming their syntax looks something like this:
Then I think we should also support the
static
keyword, for consistency:Please keep discussion of
get
andset
over in #17. If we decide not to implementget
andset
, or if we implement them in some syntax unlike what’s here, then we don’t need thestatic
keyword. I propose we add thestatic
keyword only if we addget
andset
keywords. We would also keep the@methodName
syntax, for backward compatibility.The text was updated successfully, but these errors were encountered: