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]>

> On 4 Dec 2022, at 10:50, Julien Fischer <[email protected]> wrote:
> 
> On Sun, 4 Dec 2022, Sean Charles (emacstheviking) wrote:
> 
>> And the code, I just don't understand, as usual, what the compiler is
>> trying to tell me. The io.nl/2 <http://io.nl/2> is det, so that can't fail, and
>> presumably the field update can't fail either. And why hasn't this
>> error been raised on all the other cases?
>>      59 :- pred write_(fstate::in, fstate::out, fi::in, io::di, io::uo) is det.
>>      60
>>      61 write_(!S, nl, !IO) :-
>>      62     io.nl <http://io.nl/>(!IO),
>>      63     !:S = !.S ^nl_written := yes.
>>      64
>>      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?

_______________________________________________
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.