[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Disallow empty "or" type specifier
From: |
felix . winkelmann |
Subject: |
Re: [PATCH] Disallow empty "or" type specifier |
Date: |
Tue, 26 Sep 2023 12:07:32 +0200 |
> It certainly shouldn't be *, nor should it be an error... technically an
> empty union should be a null set, which would correspond to either a
> non-extant type or to no return/value at all...
Well, the problem is: there is no non-extant type, no "bottom": we simply use
the Scheme type system (slightly extended) that clearly describes what types
values can have and in Scheme every value has a type, there are no programs
that are unsound on the type level - they may break at run-time, but are still
valid Scheme code. There are meta-types like "undefined", which is the same
as the union of all possible types, but explicitly declared as undefined by
the standard. CHICKEN uses other meta types like "*" for convenience, and
"or" and "forall" for limiting the possible set of types a value can have, but
there are still very much concrete types for concrete values.
The number of return values on the other hand is not a type-related concept, it
is
an operational thing (the number of arguments to pass to the continuation), so
I
would not mix these two issues.
There can be no "(or)"-typed value in a Scheme system, there can be the absence
of
a return (like calling a continuation), but that is, I believe, the area of
effect systems.
felix