New keyword for method

Hi,

What are the drawbacks for not having separate keyword for method, something like meth or method, Why func for method?, is it not simple enough to address method with same name for supporting readability and clarity of intent

Thanks,
Saurabh

  1. This ship has sailed long ago. Swift is not going to introduce a new keyword to replace an existing one.
  2. All methods are functions, but not all functions are methods. It makes sense to use a term that describes all functions, and not just a subset.
7 Likes

It is similar to using "let" and "var" for members. The reason of this reuse (for very similar things) – is to keep the number of keywords small.

1 Like