I remember somewhere seeing such a notation for formally defining a variable:
variable_name: type
And similarly:
function_name(....): return_type
But I don’t remember and I can’t find the formal definition of this syntax.
My question first is, is this really a formal syntax or did somebody just make it up? My second question, can you give me the name for it, or a reference?
I am asking because I was wondering how the function arguments are defined. Would it be like this?
function(arg1:type1, arg2:type2): type
If so, how are default values shown?
The syntax you describe is used in the ML family of programming languages. In Standard ML, which has a formal semantics, there are no default values, everything must be initialized when declared.