Case-insensitive defines
Frank Heckenbach
frank at g-n-u.de
Fri Apr 7 15:39:03 CEST 2000
Maurice Lombardi wrote:
> What about command line defines, as
>
> gpc -DPostScript ...
>
> would it be case sensitive ? I would prefer no, but is there any problem ?
Oh right. I forgot to mention them, it's good you did...
Well, I think the implicit defines (`__GPC__', `__FOO_PASCAL__',
`DJGPP', etc.) should remain case-sensitive.
For user-supplied options, we have the choice. Again, I see reasons
to have case-sensitive ones, too. E.g., I have some programs which
work alternatively with GMP (multi-presicion) or normal numbers, and
I use `-DGMP' to select the GMP version. Since the unit is also
called `GMP', it would conflict if it's case-insensitive (whereas
now I can write `uses Gmp' to avoid a conflict).
So, we could allow both on the command-line as well, we'd just need
different option names.
The problem is that `--define' in GCC is equivalent to `-D' and
case-sensitive, and I think we shouldn't change this to keep
interoperability with GCC as good as it is now. But we could add a
new option for case-insensitive defines.
J. David Bryan wrote:
> > 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).
I'd vote against the hyphen because it's an acronym that follows.
BTW, since the directive itself is case-insensitive, you could write
it as {$DefineCS} to make it clearer...
Dr A Olowofoyeku wrote:
> 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}.
With the above consideration about the command line, I suggest
perhaps `csdefine' and `cidefine' for case-sensitive/-insensitive
defines. Both would work on the command-line and as compiler
directives. Besides, `define' as a directive is case-insensitive
(because of BP) and `--define' on the command line is case-sensitive
(because of GCC).
Or the same with `definecs', `defineci'.
Frank
--
Frank Heckenbach, frank at g-n-u.de, http://fjf.gnu.de/
GPC To-Do list, latest features, fixed bugs:
http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html
More information about the Gpc
mailing list