Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do "schema" and "meta symbol" mean in F# expressions?

Tags:

f#

I'm working through a textbook on F# and after introducing the factorial function

let rec fact = function | 0 -> 1 | n-> n * fact(n-1);;

the authors also point out that the evaluation of an expression containing fact might not terminate and add in a footnote

Note that a text like fact n is not part of F#. It is a schema where one can obtain a program piece by replacing the meta symbol n with a suitable F# entity.

This has gone right over my head! Although I'm happy with how fact works, and with recursion in other languages, I can't see the distinction the authors are trying to make here. Any explanations welcome.

like image 215
TooTone Avatar asked Sep 04 '13 16:09

TooTone


1 Answers

I suspect all they're trying to say is n represents a value (i.e., "F# entity") being passed to the function. fact n is not meant to be valid F# code.

It's legalese for "n is a placeholder."

like image 164
Daniel Avatar answered Nov 07 '22 15:11

Daniel