[mercury-users] Inaccuracy in language definition ?

Holger Krug hkrug at rationalizer.com
Mon Jul 16 22:08:19 AEST 2001


(Please excuse the style of writing, English is not my mother tongue.)

> > Even more, it seems not necessary for the compiler to
> > recognize, how an abstract type might be defined, because for the
> > compiler the abstract type and the other type, it might be defined to
> > be equivalent with, are not interchangeable.
> 
> That approach would mean that the a goal might have different
> semantics depending on which module it was in, even when all
> the names in the goal are fully module-qualified.  

I understand you this way: If a goal is in a module, where only the
type declaration is visible (abstract type), the semantics would
differ from the appearance of the same goal in a module where the type
is defined.

If the goal appears in the implementation section of the module, this
should not be a problem at all, because it's the module maintainers
task to understand (and comment and document) his/her own
implementation.

If the goal appears in the interface section, the semantics should be
based on what is visible in the interface section only. And this is
the same for all modules importing the interface section and for the
interface section itself. So the semantics of the goal would only
depend on its appearance, if it appears in the implementation section
of the same module, where the abstract equivalence type actually is
defined. And this should be OK. (To avoid this one would have to treat
equivalence types as really new types not only as abbreviations. But
even if they are treated as abbreviations, they can only be treated so
in those scopes, where their definition is visible. In all other
scopes they must be treated as new types to be digestible for
programmers acquainted with today's mainstream OO technology.)

> That would
> make intermodule optimization difficult.

Why ?


-- 
Holger Krug
hkrug at rationalizer.com
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list