What is Type Completeness Principle?

Question:

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.

Asked By: Still Learning

||

Answers:

The Type Completeness Principle:

No operation should be arbitrarily restricted in the types of values
involved.

  • David A. 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.

Answered By: The Room
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.