TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Subject:
From:
Tucker Taft <[log in to unmask]>
Date:
Tue, 1 Dec 1998 14:33:18 -0500
X-To:
Reply-To:
Tucker Taft <[log in to unmask]>
Parts/Attachments:
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);
 or
   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]

ATOM RSS1 RSS2