[m-rev.] For review: State-variable record update transformation

Jonathan Morgan jonmmorgan at gmail.com
Fri Jun 1 22:55:27 AEST 2007


On 5/31/07, Peter Ross <pro at missioncriticalit.com> wrote:
> On 5/30/07, Jonathan Morgan <jonmmorgan at gmail.com> wrote:
> > This change was posted a few months ago (see
> > http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-reviews/mercury-reviews.200703/0015.html)
> > and never committed.  The changes to the compiler and reference manual
> > were reviewed, but the test case and NEWS file weren't.
> >
> > Jon
> >
> > ========================================================
> > Estimated hours taken: 2.5
> > Branches: main
> >
> > Enhance the state variable notation to recognise !X ^ field_list :=
> > Term as a synonym for
> > !:X = !.X ^ field_list := Term.
> >
>
> I would add a test case for
>     !X ^ index(3) := 5
> and make sure that your code handles this.

I added the following predicate to the test case, and it worked as expected.

:- pred test3(map(string, int)::in, map(string, int)::out) is det.
test3(!Map) :-
    !Map ^ elem("1") := 1,
    !Map ^ elem("2") := 2.

> If it does, then it looks fine for me.

I've committed it.

Jon
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list