Hacker News new | past | comments | ask | show | jobs | submit login

That is the point. Swift has a primary usage unlike other languages. That is okay.



`callAsFunction` is not for Swift's primary usage. It is for Python interop, used by Swift For TensorFlow. Its design is such that you should never need to know it exists unless you're designing your own Python (or other scripting) interop layer.


Then it should be some kind of python-interop module. These kinds of useless syntax hax shouldn't be introduced into the main language. >99% of swift devs will never ever "interop with python", yet they all have to pay the price of this change.


I could see its use in math-heavy code as well. That might be a rather narrow domain, but one where features like this (or operator overloading for another example) do help to reduce syntactic pain.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: