Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Smalltalk, Objective-C and Swift (from the languages I know) have a syntax similar to that. Only it doesn't need parenthesis, so it's more like:

[hit: ball with: bat]

The method is called 'hit:with:'.

Thought they don't go overboard with the "like english" thing, they mostly use the extra keys for disambiguating arguments. E.g.:

[fileWrapper writeToFile: path atomically: YES updateFilenames: YES];



Didn't know that. Cool, thanks for mentioning.




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

Search: