First of all: my "english-power" is not so good, so it is absolutely
possible that i dont use the right expression in some cases which may lead
to misunderstandings.(like compiler state...).
if anyone of you gets the impression, that there is such a situation,pls ask
once, before we discuss, only because i dont know the english language perfectly.
1.PERSONAL REPLIES
==========================================================
- HI ALEKS: of course there is no compiler state(just ment what the compiler knows
for the moment it runs) thx for reply.
- HI WYLIE: i fully agree with you.
- Hi HARALD: i am never bored or angry in reading comments of experienced programmers.
Also i like to mention that my pseudo-code was very unluckily.
Finally it has nothing to do with the problem i describe in point 2.
Constants are regularly put to headers, and they have to be defined.
So in this view definitions are a natural part of headers.
including operations must not be sequentiell operations.Especially where
include-fileS are interleaving and my produce loops and similar stuff.
include-files are including also includes which may cause unwanted redefinitions
or whatever...So it is not unusual to put defines around includes to avoid
multiple including-operations.There are a lot more reasons to "protect"
an include-advice.
Pls dont conclude on any experience anyone of the programmers have.
Everyones knowledge leaks in some situations,unfortunately in this
case at a very basic point.But if you read point2 carefully, you will
recognize i just leaved the "straight-on" road for just a moment.
With a plausibel idea, which was a wrong idea.Thats all and has nothing
to do with any experience,although i enforced your impression by the
frazzle of pseudocode. This is just a wrong conclusion, with most
respect to you.
- Hi BO: i also fully agree with your post.Sometimes when thinking around a trivial problem
i get a little bit confused after a while. I think anyone of you know that.
- Hi Marco: received your post at the moment. You are absolutely right!
2.THE CONFUSED IDEA WAS...
(NOT IN MIND ANY TRICKY CODE OR ANY OPTIMIZATION!)
==========================================================
STATEMENT1: "extern const type c_name = value;"
STATEMENT2: "extern const type c_name;"
The only thing i tried was absolut natural idea, i just wanted to share a "GLOBAL CONSTANT"
like everyone does with variables through putting it to a header.
For some reason i thought i dont need STATEMENT1 multiple times, it would be enough to have STATEMENT2.
I thought STATEMENT1 has to occur only one time anywhere in the project.
" And i must accept that this is simply wrong "
The STATEMENT2 simply leaks because it is a "dependent" statement,
of what the compiler knows for the moment.(Thats the mistake, not more or less).
(Discussing how to handle headers by just having a frazzle of pseudocode doesnt make much sense to me.Although i must admit, that it(pseudocode) wasnt rich in its contents and looked very poor
Moreover it has absolut no effect on the problem i described in this point.
The only question was, if STATEMENT2 works or not, it works but not
propper, so i will forget it, and i have learned some more basics)
(a little more suprise to me, that none of you ever tried such a statement within years of programming. You all know MURPHY LAW
, what you can do wrong you will do wrong. Now me was just one more victim
)
3.PRINCIPAL SOLUTION
==========================================================
It is very easy, last but not least, to get a propper source, i have to have the definitions for a
constant at hand (no way around).To make that sure it is necessay to make STATEMENT1 available
for a modul(directly put in, or having header including this), to avoid dependencies.
This was my final post on this topic, thx again for all comments, although
i wasnt able to tell you what i meant correctly at first,
although the confusing pseudocode,
although the thread had nothing to do with chessprogramming(especially for that!!)
You are all welcome on my next thread.