When people talk about F# they sometimes mention the term top-level
;
what does top-level
mean?
For example in previous SO Q&A
Error FS0037 sometimes, very confusing
Defining Modules VS.NET vs F# Interactive
What the difference between a namespace and a module in F#?
AutoOpen attribute in F#
F# and MEF: Exporting Functions
How to execute this F# function
The term also appears regularly in comments but for those Q&A I did not reference them.
The Wikipedia article on scope touches on this, but has no specifics for F#.
The F# 3.x spec only states:
11.2.1.1 Arity Conformance for Functions and Values
The parentheses indicate a
top-level
function, which might be a first-class computed expression that computes to a function value, rather than a compile-time function value.
13.1 Custom Attributes
For example, the STAThread attribute should be placed immediately before a
top-level
“do” statement.
14.1.8 Name Resolution for Type Variables
It is initially empty for any member or any other
top-level
construct that contains expressions and types.
I suspect the term has different meanings in different contexts: Scope, F# interactive, shadowing.
If you could also explain the origins from F# predecessor languages, (ML, CAML, OCaml) it would be appreciated.
Lastly I don't plan to mark an answer as accepted for a few days to avoid hasty answers.