texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] enums patch


From: Stéphane Payrard
Subject: Re: [Texmacs-dev] enums patch
Date: Thu, 12 Sep 2002 19:56:20 -0400
User-agent: Mutt/1.4i

On (12/09/02 18:33), Joris van der Hoeven wrote:
> From: Joris van der Hoeven <address@hidden>
> To: address@hidden
> Subject: Re: [Texmacs-dev] enums patch
> Reply-To: address@hidden
> Date: Thu, 12 Sep 2002 18:33:59 +0200 (MET DST)
> 

> 
> The point is not that much about what is permitted or not,
> but whether such a thing should be considered to be a *data type*.
> I understand your point of avoiding to use the preprocessor,
> but is this really *that* important in this case?
> 
> 

The prepocessor is illiterate so he can generate code that does not
even parse. This leads to evil searches in the huge output of gcc -E
to figure out why the code does not even compile. An example if I
include Qt headers before X ones, I get weird parse errors because of
Qt symbols being the same as #define(d) ones by X.  Also, it is all to
easy to define the same symbol with different value/types in different
part. You can catch if the definition are visible from the compiler
and the linker.


This is enough to postulate as a general rule to remove everything
possible from the hand of the preprocessor.  Besides that point which
is the important one, I agree that enum are just a convenience. each
enum a type that implicitely convert to integer types which is enough
for what can be done with them. As a type one can use operator
overloading but this is just a 2 line mention in one page entry (see
4.8 p 77) for enums in the reference manual.

I see no reason to shy away from enums. They group related consts
which is a good thing. There is no reason to ask oneself metaphysical
question about the type difference between bitmasks and "true"
enumerations. The C++ language has no support for such differentations
anyway so that is a moot point.

Really, I did not expected to have to argue about a so minor patch.

More generally, I want TeXmacs to succeed to link with many libraries
so that it can be used for many things. For doing that it is good to
adopt mainstream conventions. I empathize with your notion of code
purity but to suceed you code will need to have intercourse with other
libraries and the mixing of code with wildely different conventions is
_very_ ugly. You remind me very much of the young sihk who got
problems in Canada because he wanted to comply with his religion and
had to carry knife everywhere. The problem was not that his religion
was bad and if it makes sense or not to carry a knife, it was that it
was not part of the accepted culture in which he had to blend.

When you trade somewhere you have got to learn the accepted
conventions, you choosed C++ so use the prevalent C++ conventions to
get a chance to attract good C++ coders.

I know that you can answer that I just have to learn and accept the
TeXmacs coding culture. But it is not a culture because it is not
really accepted by anyone but you and it is probably a good reason why
there is very few people willing to spend much time in TeXmacs code
except for a quick fix. Too bad because your interactive typesetter is
a unique value in the Open Source world.

And I tell you that as a Perl hacker which is a culture that is very
tolerant about peculiar cultures even only to be able to steal as many
good ideas as possible.

--
  stef




reply via email to

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