> Indeed, ML completely unifies Cartesian product types and tuples in a > very, very cool way: > > Every function takes exactly one argument > and yields exactly one result. > > However, the argument or result can be a tuple. > > So in ML, when I write > > f(x,y) > > that really means to bundle x and y into a tuple, and call f with that > tuple as its argument. So, for example, if I write > > val xy = (x,y) > > which defines a variable named xy and binds it to the tuple (x,y), then > > f xy > > means exactly the same thing as > > f(x,y) > > The parentheses are really tuple constructors, and ML doesn't require > parentheses for function calls at all. ABC did this, and very early Python did this, too (but Python always required parentheses for calls). However, adding optional arguments caused trouble: after def f(a, b=1): print a*b t = (1, 2) what should f(t) mean? It could mean either f((1, 2), 1) or f(1, 2). So we had to get rid of that. I suppose ML doesn't have optional arguments (in the sense of Python), so the problem doesn't occur there; that's why it wasn't a problem in ABC. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4