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

Sean Charles (emacstheviking) objitsu at gmail.com
Sun Dec 4 23:19:28 AEDT 2022


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 <zoltan.somogyi at runbox.com> wrote:
> 
> 
> 
> On Sun, 4 Dec 2022 12:02:58 +0000, "Sean Charles (emacstheviking)" <objitsu at gmail.com> 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.
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20221204/f514b342/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: favicon.ico
Type: image/vnd.microsoft.icon
Size: 318 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/users/attachments/20221204/f514b342/attachment.ico>


More information about the users mailing list