Next: , Previous: , Up: built-in   [Contents][Index]


6.3 The universal sub–type

Core Type: <bottom>

A conventional type that is the sub–type of all the other types.

We must never use <bottom> as type annotation for variables, because no value is of this type:

(define {O <bottom>}
  123)
error→ &expand-time-type-signature-violation

(let (({O <bottom>} 123))
  O)
error→ &expand-time-type-signature-violation

casting to <bottom> also fails:

(cast-signature (<bottom>) 123)
error→ &expand-time-type-signature-violation

(unsafe-cast-signature (<bottom>) 123)
error→ &expand-time-type-signature-violation

The expressions that raise a non–continuable exception have type <bottom>:

(type-of (error #f "wrong"))
⇒ #[signature <bottom>]

notice that the type signature is the improper list <bottom>, not the list (<bottom>).

As usage example, the following type annotation defines a function signature in which the argument can be any value:

(define-type <my-func>
  (lambda (<bottom>) => (<string>)))

<bottom> is removed from union and intersection type annotations:

(type-annotation (and <bottom> <fixnum>))
⇒ #[core-type-spec #[type (<fixnum>)]]

(type-annotation (or  <bottom> <fixnum>))
⇒ #[core-type-spec #[type (<fixnum>)]]