Re: Windows stuff...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Regarding constant declarations, standardisation, and what should and
should not be included in Euphoria standard distribution

> Tommy Carlier wrote:
> > If such a standard API-library would be made, the constants should have a
> > prefix, to
> > reduce the chance of possible naming conflicts.

As many have said, this is a bad idea.. I have enough trouble
remembering constant names as it is!

Derek wrote:
> Don't make that mistake again. The prefixes are not needed if we regard
> the Microsoft names as reserved words.

Maybe that's going too far in the other direction. At the moment,
Euphoria has about 30(?) reserved words. It doesn't need several
thousand.

It seems to me, that as part of the Euphoria standard distribution,
Rob should add an include file containing, simply, all of the windows
API constants. Want access to them? Just include the file.

Given all the problems with namespacing, this could make things
difficult. Library A uses the constants in the standard include file.
Library B defines their own... = problems!

Rob, I think you need to make a change to the interpreter:
If a constant is defined multiple times, to the same value ...
e.g.
<<win32lib.ew>>
global constant True = 1, False = 0
...

<<vectorlib.e>>
global constant True = 1
global constant False = 0
...

And a program includes both of them... It should just ignore it, or
put up a warning.
If a constant is assigned to a function return, or an offset of an
earlier constant, that should be counted as well.
If someone's sadistic enough to define True as 0 and False as 1, then
it should report errors... constants are constants - they should have
the same values.




-- 
MrTrick

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu