Just found two related questions
In programming languages, from Michael Scott's Programming Language Pragmatics
In general, a value in a programming language is said to have ﬁrst-class status if it can be passed as a parameter, returned from a subroutine, or assigned into a variable. Simple types such as integers and characters are ﬁrst-class values in most programming languages. By contrast, a “second-class” value can be passed as a parameter, but not returned from a subroutine or assigned into a variable, and a “third-class” value cannot even be passed as a parameter.
Labels are third-class values in most programming languages, but second-class values in Algol. Subroutines display the most variation. They are ﬁrst-class values in all functional programming languages and most scripting languages. They are also ﬁrst-class values in C# and, with some restrictions, in several other imperative languages, including Fortran, Modula-2 and -3, Ada 95, C, and C++. 11 They are second-class values in most other imperative languages, and third-class values in Ada 83.
What is the mathematics foundation for first/second/third class values in programming languages?
The terminology reminds me of first/second order logic, but are they related?
It seems to me that the difference between them is which specific case a value can be used
- passed as a parameter,
- returned from a subroutine, or
- assigned into a variable.
Why are the specific cases important, while not other cases not mentioned?