Talk:F Sharp Programming/Values and Functions

Declaring Variables

“Variable” should probably be reserved for mutable objects, as is noted later on in the page. I prefer to think of the “let” keyword as assigning labels (identifiers) to functions or values. In effect what I’m getting with “let” is a convenient way of recalling/reusing an expression by name. Another way could be to think of “let” as always binding to a function, with “let x = 5” creating a function “x” that always returns 5. Conceptually “let z = add 5 10” binds the expression “add 5 10” to the identifier “z”, even if the compiler decides to replace z with the value 15.

Currying Example
I would recommend using Increment instead of Add5 as an example for the currying of the addition of two numbers function; it is just a more meaningful concept, and many Algol style programming languages support it through the privileged ++ operator. --71.20.100.94 (talk) 21:59, 25 October 2010 (UTC)

Parameterless function
The article currently says,
 * Functions return unit when they don't need to return any value to the programmer. For example, a function that prints a string to the console obviously doesn't have a return value:
 * let helloWorld = printfn "hello world"
 * This function takes no parameters and returns .

I'm a bit confused by this. What is the "function (that) takes no parameters"? It presumably is not "printfn", because that takes parameters. So is it "helloWorld"? I'm an F# newbie, but it looks like helloWorld is a value of type unit, not "a function that prints a string to the console". Matt Crypto (talk) 13:00, 18 December 2009 (UTC)

"helloWorld" would be the function that's refered to in the sentence 'This function takes no parameters and returns .' Andreartus (talk) 14:49, 2 May 2010 (UTC)

Recursive function
recursive function needs a better explanation. There is no explanation and was very difficult to understand.