Re: Typechecking union types (Hans Aberg)
5 Jul 2006 15:15:51 -0400

          From comp.compilers

Related articles
Typechecking union types (Thomas Christensen) (2006-06-27)
Re: Typechecking union types (Curtis W) (2006-07-05)
Re: Typechecking union types (Hans-Peter Diettrich) (2006-07-05)
Re: Typechecking union types (2006-07-05)
Re: Typechecking union types (Thomas Christensen) (2006-07-28)
| List of all articles for this month |

From: (Hans Aberg)
Newsgroups: comp.compilers
Date: 5 Jul 2006 15:15:51 -0400
Organization: Mathematics
References: 06-06-072
Keywords: types
Posted-Date: 05 Jul 2006 15:15:51 EDT

Thomas Christensen <> wrote:

> For my master thesis, I need to get up to speed
> on the current state of the art within the somewhat
> narrow field of typechecking union types.

In C/C++, one can, along with the union, write a struct with an enum
providing the type, which can be used for dynamic type checking.

A C++ polymorphic (virtual) class hierarchy is viewed as a dynamic type
checked replacement for unions. In order to avoid having to modify the
base class whenever a new class is added, RTTI was introduced. See
Bjarne Stroustrup's DEC++ book for motivations.

There is some union like static type checking in C++, using something
called "variants":

    Hans Aberg

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.