Re: [m-users.] GitHub release "aio" -- ANSI I/O support.
"Sean Charles (emacstheviking)" <[email protected]> Sat, 24 Aug 2024 14:06:38 +0100
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
Understood!
My code is now:
:- mutable(astate, aio_state, aio_state(yes, no), ground, [attach_to_io_state]).
enable_colours(Mode, !IO) :-
get_astate(aio_state(_, Quiet), !IO),
set_astate(aio_state(Mode, Quiet), !IO).
and the little test case of it:
main(!IO) :-
aio.format("@bp: @tk: @cr: @:) @:| @:( \n", [], !IO),
enable_colours(no, !IO),
aio.format("@bp: @tk: @cr: @:) @:| @:( \n", [], !IO).
That's a much nicer way and thanks for pointing it out to me, again, my brain isn't that good lately.
Thanks,
Sean.
> On 24 Aug 2024, at 13:27, Volker Wysk <[email protected]> wrote:
>
> attach_to_io_state
_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users