Hi,
as you might know, GPC supports "defines" for two purposes, as conditionals for `ifdef' etc. (like some other Pascal compilers do), and as macros (like the C preprocessor).
However, currently they're case-sensitive (like in C) which is different from other Pascal compilers (e.g., Borland Pascal) and generally not very "Pascalish", so I want to introduce case-insensitive defines. But there are also a few valid uses for case-sensitive defines, so I'd like to keep both.
Actually, I've already done most of the work. The question that remains is about the syntax. Currently, GPC understands:
#define foo -- inherited from the C preprocessor, but not recommended
{$d foo} -- we plan to change this. More precisely, we want to drop all the one-letter directives except those compatible to BP as well as $M (not the same as in BP, but no problem as it will only write a harmless message for the BP memory directives which are unnecessary in GPC) and $W (warnings -- quite widely used).
{$define foo} -- this is what BP uses.
So for BP compatibility, we should probably make {$define} case-insensitive, and rename {$d} to something longer and leave it case-sensitive.
Any suggestions? I thought of maybe {$def}, but this wouldn't make the difference to {$define} very clear. OTOH, something like {$define-case-sensitive} would make it clear, but it's very long. Peter has suggested {$cdefine} (c for `C' or for `case'). We're not very fond of either of them, perhaps someone has got a better idea...
Frank
Hi,
What about command line defines, as
gpc -DPostScript ...
would it be case sensitive ? I would prefer no, but is there any problem ?
Maurice
On Wed, 5 Apr 2000, Frank Heckenbach wrote:
Any suggestions? I thought of maybe {$def}, but this wouldn't make ... very fond of either of them, perhaps someone has got a better
Hmmmm... How 'bout {$definecs foo} ? Unless you use {$define-case-sensitive foo}, the docs are going to have to explain what it is anyway.
See ya! Orlando Llanes
"Meine Damen und Herren, Elvis hat soeben das Gebaeude verlassen!"
"Look out fo' flyeeng feet" O__/ a010111t@bc.seflin.org /|____. O <__. /> / \ ____________|_________ http://ourworld.compuserve.com/homepages/Monkey414
all the one-letter directives except those compatible to BP as well as $M (not the same as in BP, but no problem as it will only write a harmless message for the BP memory directives which are unnecessary in GPC) and $W (warnings -- quite widely used).
{$define foo} -- this is what BP uses.
Vote in favour :-)
FPC and Delphi also do this, so since you do this because of consistancy, why not go the entire way :-)
Marco van de Voort (MarcoV@Stack.nl) http://www.stack.nl/~marcov/xtdlib.htm
Marco van de Voort wrote:
{$define foo} -- this is what BP uses.
Vote in favour :-)
FPC and Delphi also do this, so since you do this because of consistancy, why not go the entire way :-)
This is not the problem. {$define foo} will be the case-insensitive version as it is in BP, FPC, and Delphi.
The problem is how to call the case-sensitive version.
Peter
On 5 Apr 2000, at 19:07, Frank Heckenbach wrote:
I thought of maybe {$def}, but this wouldn't make the difference to {$define} very clear.
Agreed, it would look like an abbreviation, rather than a semantically different command.
OTOH, something like {$define-case-sensitive} would make it clear, but it's very long.
{$define-cs} would be OK (better than {$definecs} only because the "cs" part stands out better with the hyphen).
Peter has suggested {$cdefine} (c for `C' or for `case').
That makes me think of a "define something having to do with the C language" rather than "define with case sensitivity." But that might be OK too, because it can also mean, "define with C preprocessor semantics," i.e., case sensitivity.
So I'd suggest either {$define-cs} or {$cdefine}. The more I think of {$cdefine}, however, the more I like it!
-- Dave
On 5 Apr 00, at 19:07, Frank Heckenbach wrote:
Hi,
as you might know, GPC supports "defines" for two purposes, as conditionals for `ifdef' etc. (like some other Pascal compilers do), and as macros (like the C preprocessor).
However, currently they're case-sensitive (like in C) which is different from other Pascal compilers (e.g., Borland Pascal) and generally not very "Pascalish", so I want to introduce case-insensitive defines. But there are also a few valid uses for case-sensitive defines, so I'd like to keep both.
Actually, I've already done most of the work. The question that remains is about the syntax. Currently, GPC understands:
#define foo -- inherited from the C preprocessor, but not recommended
Why not use {$define} for case insensitive and #define for case sensitive ? Since case-sensitivity is a C thing, we might as well keep #define (which is also a C thing) for that purpose. Advantage? It avoids the introduction of new constructs.
Best regards, The Chief ----- Dr Abimbola A Olowofoyeku (The African Chief) Email: African_Chief@bigfoot.com Author of Chief's Installer Pro v5.22 for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm
Dr A Olowofoyeku wrote:
Why not use {$define} for case insensitive and #define for case sensitive ? Since case-sensitivity is a C thing, we might as well keep #define (which is also a C thing) for that purpose. Advantage? It avoids the introduction of new constructs.
I see the advantages. But in fact we want to get rid of unpascalish things such as #define and promote alternatives like {$define}.
Peter
On 7 Apr 00, at 0:53, Peter Gerwinski wrote:
Dr A Olowofoyeku wrote:
Why not use {$define} for case insensitive and #define for case sensitive ? Since case-sensitivity is a C thing, we might as well keep #define (which is also a C thing) for that purpose. Advantage? It avoids the introduction of new constructs.
I see the advantages. But in fact we want to get rid of unpascalish things such as #define and promote alternatives like {$define}.
I see. In this case I vote for {$csdefine} ('Case Sensitive Define') or {$cdefine}.
Best regards, The Chief ----- Dr Abimbola A Olowofoyeku (The African Chief) Email: African_Chief@bigfoot.com Author of Chief's Installer Pro v5.22 for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm