Linked by Jared White on Thu 24th Apr 2003 17:49 UTC
General Development There are two major varieties of Cocoa available. The first variety, possibly the more well known of the two, is the kind that you can use to make a nice warm cup of chocolate milk. While tasty, it's hardly proper subject matter for an operating systems information site. The second variety is far more on-topic: a programming environment for Apple Mac OS X that is the modern evolution of of the original NeXTSTEP frameworks. That's what I'm here to talk about today.
Permalink for comment
To read all comments associated with this story, please click here.
More named arguments...
by Anonymous on Fri 25th Apr 2003 09:20 UTC

Optional named arguments are also provided by OCaml and Ada95.

As with Python, they are particularly useful when you have default values.

In OCaml, there is the additional benefit that you can perform a partial application specifying parameters other than the first one. A brief explanation - given an f : 'a -> 'b -> 'c, you can only do f x to get a function 'b -> 'c, but with f : x:'a -> y:'b -> 'c you can say f ~y:y to get a function x:'a -> 'c . Obviously, you could always use (fun y -> f x y) but the shorthand is convenient. In simpler terms, if you apply a function without giving all the arguments, the result is a function taking the remaining arguments. Without named arguments you can only give arguments in order.