opensubscriber
   Find in this group all groups
 
Unknown more information…

m : macpascal@listman.sonic.net 23 July 2005 • 6:19AM -0400

Re: [MacPascal] New interface problem II
by Adriaan van Os

REPLY TO AUTHOR
 
REPLY TO GROUP




Florian Klaempfl wrote:

> Peter N Lewis wrote:
>> If FPC implements "const var", then this issue will die (except for
>> minior compatibility issues with the EOLed MW Pascal).
>
> I must admit, I don't like the const var syntax. Reasons:
> - it's not necessary to determine per parameter the way how "const"
> parameters are passed, it's enough to tell the compiler: let this
> function/(call) look like it was generated by a MW compiler
> - const var influences only the code generation and makes neither a
> syntactic nor a semantic difference visible to the user so it should
> exposed as little as possible to the user
> - adding the const var to interface units is error prone
> - it might be possible that some has a MW compiled library with an
> interface unit: adding the const var is error prone, adding an ifdef'ed
> {$calling mwpascal} is easy.
>
> Did I overlook something?

Yes.
The issue is not "how do I interface with a MW compiled library that
has an interface unit with CONST parameters".

First, this is mostly a hypothetical issue
Second, the MW compiler is dead
Third, such a library had better be recompiled
Fourth, CONST parameters in a Pascal interface library are a bad idea
(as pointed out by Peter)
Fifth, CONST parameter calling conventions seem to vary between
different MW compilers (!)

The real issues are:

1. Question - what is the most efficient calling convention for CONST
parameters in USER code. Answer - let the compiler figure that out for
each type, dependent of type and size.
2. Question - what convention to use for constant parameters where an
EXTERNAL ABI passes them by reference. Answer - use CONST VAR.

Regards,

Adriaan van Os

_______________________________________________
MacPascal mailing list
MacPascal@list...
http://lists.sonic.net/mailman/listinfo/macpascal

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.