[m-dev.] another interface file?

Peter Wang novalazy at gmail.com
Wed Jun 10 17:43:03 AEST 2009


2009/6/10 Zoltan Somogyi <zs at csse.unimelb.edu.au>:
> On 10-Jun-2009, Peter Wang <novalazy at gmail.com> wrote:
>> However, when intermodule optimisation is switched off, some abstract
>> equivalence types still aren't expanded properly.  Probably just bugs.
>
> No, I don't think they are. At the moment, we include the actual type
> definitions of abstract-exported types in .int files only in a carefully
> restricted set of cases, just enough to avoid problems in the grades such
> as hlc (not java). The rationale for that is that the more such definitions
> you include, the more recompilations you force when the type definition,
> and hence the content of the .int file, changes.
>
> It seems that you want to find the place where .int files are written out,
> and change the condition on WHEN you write out the definitions of
> abstract-exported types.

That's what I was planning on, but I checked some .int files to see what was
really in them (rather than what I *thought* was in them) and it turns out
that there probably isn't anything more to export.  Simon's message says it was
to avoid problems on .NET, so I think it was to solve the same problem, with
the same solution.

Peter

P.S. For these modules:

    :- module t_a.
    :- interface.

    :- type abstract.
    :- type abstract2.
    :- type abstract3.
    :- type abstract4.
    :- type abstract5.

    :- implementation.

    :- import_module t_b.
    :- import_module list.

    :- type abstract == int.

    :- type abstract2 == list(int).

    :- type abstract3
	--->    abstract3.

    :- type abstract4
	--->    abstract4(int).

    :- type abstract5 == babstract.

    %---------------------------------------------------%

    :- module t_b.
    :- interface.

    :- type babstract.

    :- implementation.

    :- type babstract
	--->    babstract1
	;       babstract2.

Here are the .int files:

    :- module t_a.
    :- interface.
    :- type abstract.
    :- type abstract2.
    :- type abstract3.
    :- type abstract4.
    :- type abstract5.
    :- implementation.
    :- import_module list.
    :- import_module t_b.
    :- type abstract == int.
    :- type abstract2 == list.list(int).
    :- type abstract3
	    --->	abstract3 .
    :- type abstract5 == t_b.babstract.

    %---------------------------------------------------%

    :- module t_b.
    :- interface.
    :- type babstract.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list