Hello,
I've just posted another article, but thought I should separate these for clarity.
First of all, similar questions have already been asked in my article as well as this article by anon.
That is: If a function has been initialised with no return, if called in an expression is it invalid, or can we safely equate it to zero. Do all functions have a decimal return type with a default of zero, or are there also void functions?
Second of all, ML seems to be relatively strict about scope (see part 12 of "Our ml Language"):
"a function's parameters and any other identifiers used in a function body are local to that function, and become unavailable when the function's execution completes"
So, can a function modify variables defined above its scope? As in, in the ML code:
a <- 3
function dosomething
a <- a + 2
print a
Will the output be 3, or 5? Can function dosomething modify the variable defined before it, or only use it as in sample 8?
Thank you.
I believe it is fine to return zero if a function doesn't have a return value.
Amitava please respond to the second question.