TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Tucker Taft <[log in to unmask]>
Reply To:
Tucker Taft <[log in to unmask]>
Tue, 1 Dec 1998 14:33:18 -0500
text/plain (43 lines)
> ...
> Thus users of my binding need a different pragma
> on windows to other platforms.
> How can this be done without changing the code,
> or having two versions of it?
> If only I could rename conventions.
> In C, this is accomplished with cpp using #defines
> in a machine dependent header file.

This is an interesting point.  Ada 95 allows renames of
almost everything (generics couldn't be renamed in Ada 83).
However, pragma arguments are not "normal" identifiers, and
are not susceptible to renaming.

This might argue for a general capability to define a renaming
for pragma arguments.  E.g., something like:

    pragma Argument_Define(Newname, Oldname);

Then anyplace "Newname" is used as a pragma argument, it is treated
as though "Oldname" has been used instead.

This would presumably be useful primarily as a configuration pragma.
Then compiling one of the following configuration pragmas:

   pragma Argument_Define(JNI_Default, Stdcall);
   pragma Argument_Define(JNI_Default, C);

and then using

   pragma Import(JNI_Default, ...);

would provide the desired source-level portability.

Ahhh, isn't language design fun?

> ...
> Thanks for any help.
> Geoff

-Tucker Taft  [log in to unmask]