[m-users.] Confused my det/multi error message, full disjunction of type in place.
Julien Fischer
jfischer at opturion.com
Sun Dec 4 21:50:30 AEDT 2022
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 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(!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.)
Julien.
More information about the users
mailing list