In the book Programming Language Design Concepts, it says :
PYTHON counts procedures as first-class values, along with all primitive and composite values. Thus PYTHON conforms well to the Type Completeness Principle.
I still didn't get it.
The Type Completeness Principle:
No operation should be arbitrarily restricted in the types of values involved. - Watt
First-class values can be evaluated, passed as arguments and used as components of composite values. Functional languages attempt to make no class distinctions, whereas imperative languages typically treat functions (at best) as second-class values.
Pretty much all programming languages limit the kinds of entities that may be pass as values (and therefore have a meaningful type). In C or C++, functions are not values, though pointers to functions are. Classes are not values.
In Java, methods and classes are not values, though you can obtain a reified object representing a class as a value, and in Java 8, you can pass method references as values. Packages are not values, however.
In Haskell, functions are first-class values, so can be passed as arguments and returned as values. Since Haskell is statically typed, the type system is capable of expressing function types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With