Re: Typechecking union types

haberg@math.su.se (Hans Aberg)
5 Jul 2006 15:15:51 -0400

          From comp.compilers

Related articles
Typechecking union types tc@elvis.dk (Thomas Christensen) (2006-06-27)
Re: Typechecking union types cwarren89@gmail.com (Curtis W) (2006-07-05)
Re: Typechecking union types DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-07-05)
Re: Typechecking union types haberg@math.su.se (2006-07-05)
Re: Typechecking union types tc@elvis.dk (Thomas Christensen) (2006-07-28)
| List of all articles for this month |
From: haberg@math.su.se (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 <tc@elvis.dk> 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":
   http://www.boost.org/doc/html/variant.html


--
    Hans Aberg



Post a followup to this message

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