| PLEX86 | ||
Curried Sanskrit, the secret of India's outsourcing success. Obscurity, linuxScience: a dead end career 23 On Sun, 22 May 2005 23:50:06 +0100, Dirk Bruere at Neopax Well said. I recall Senator John Button (?) saying something along the lines of Australia needing more people...
Those of us who are prefer functional and logic programming look at Sanskrit as the first functional logic language. After all, which other language has currying as a native word ? Currying in Functional Languages Functional languages such as Haskell and ML enjoy the benefits of function currying. Currying is the incomplete application of arguments to a function. For example, in Haskell we could write the function mult which takes two integers and returns their product Advice to a young scientist On Sun, 15 May 2005, Taenia Solium The one comparison I like to make is documented on my website scientist is about 12... mult x y = x * y Evaluating mult 2 6 would yield 12, as expected. To curry a function, one needs only to leave off one or more of the rightmost arguments. (Argument application must occur in a left-to-right order.) Evaluating mult 2 would yield the curried function (mult 2), which is a function of arity 1 (meaning it expects 1 argument). An argument can be applied to this function by evaluating (mult 2) 6, for instance. The inclusion of parentheses is important because it distinguishes the application of one argument to a curried function from the application of two arguments to a non-curried function. Functions can be built of curried functions as double = mult 2 (or equivalently) double = (*) 2 where (*) is the prefix application of the infix multiplication operator. The expression (2 *) is equivalent to (*) 2, but prefix operators are better for understanding function currying. Evaluating double 6 then yields 12.
|
||||
Alt Computer Consultants from Newsgroups |
||||