Re: [m-users.] Confused my det/multi error message, full disjunction of type in place.

"Sean Charles (emacstheviking)" <[email protected]>
Newsgroups gmane.comp.lang.mercury.general
Message-ID <[email protected]>
And suddenly it all becomes clear!
Problem solved.

I think I might change the nano syntax colouring so dots are red! I have though learned something from Julien, I probabl read it once but it long since fizzled away from working memory, regarding field updates.

In another post, Julien stated that 

>      63     !:S = !.S ^nl_written := yes.
> 
> That last line can be more concisely written as:
> 
>      !S ^ nl_writtern := yes


but the only example of field updating I remember seeing in the manual was this one whic has been my guide ever since, (https://www.mercurylang.org/information/doc-release/mercury_ref/Field-access-examples.html#Field-access-examples)

:- func type1 ^ increment_field3 = type1.
Term0 ^ increment_field3 =
    Term0 ^ field1 ^ field3 := Term0 ^ field1 ^ field3 + 1.

but then, going to 11 on RTFM, I found the relevant information on this page:
https://www.mercurylang.org/information/doc-latest/mercury_ref/Clauses.html#State-variables

under the section 'State variable field updates'.

Excellent.

I knew it was my fault.

I don't like tattoos but I may well get to the point of having RTFM placed somewhere, someday.

Thanks Zoltan and Julien.

Onwards.........

Sean.






> On 4 Dec 2022, at 12:06, Zoltan Somogyi <[email protected]> wrote:
> 
> 
> 
> On Sun, 4 Dec 2022 12:02:58 +0000, "Sean Charles (emacstheviking)" <[email protected]> wrote:
>>>>     65 write_(!S, brace_o, !IO) :-
>>>>     66     write_(!S, s("{"), !IO),
>>>>     67     !:S = !.S ^tab_size := !.S ^tab_size+1.
>>>                                                   ^^^
>>>>     68     write_(!S, nl, !IO).
>>> 
>>> Presuambly, the period marked above is actually supposed to be a comma.
>>> (Because it's a period, you have two clauses that match nl.)
>> 
>> Why would it be a comma? I just don't understand, "!,S" ??? That's a syntax error surely?
> 
> The email system mangles indentation. Julien was not pointing
> to the period in !.S, but to the period at the END of the line.
> 
> Zoltan.
> 
>

_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.