help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %union errors that shouldn't be there


From: Hans Aberg
Subject: Re: %union errors that shouldn't be there
Date: Thu, 24 Mar 2005 19:20:47 +0100

At 11:10 +0100 2005/03/24, Laurence Finston wrote:
 > It would not be the old union, but a new union with new required
 semantics, that is clear.

My point was that `union' is an element of the C and C++ languages,
whereas your new `Union' class would not be.  I think this is important,
others may not.

This discussion is very confusing, because it mixes two topics: Extending C++, and what is appropriate for Bison. As for the latter question, one would have to give iyt a different name that %union. But with the %typed and other features suggested here (%define), that would not be a problem.

 > >The compatibility of C++ to C is not complete but reasonably close.
 >I think this is one of the best and most important features of C++.

 Personally, I think this is one of the biggest hurdles with C++,
 because it inherits all C language quirks.

Stroustrup gives very thorough explanations of why he decided to do it
this way and is very open about the disadvantages.  There is no free
lunch.  It certainly makes it easier for a C programmer to start using
C++.  If it were not so, I suspect it would make it more difficult or even
impossible to do the kind of low-level programming with C++ that's
possible with C.  If this were so, it would make C++ useless from my
point of view.  (I know not everybody will agree me.)

C++ has been developed over several decades. And some of the later C++ features have problems to coexist with C.
--
  Hans Aberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]