[m-users.] GitHub release "aio" -- ANSI I/O support.

Volker Wysk post at volker-wysk.de
Sat Aug 24 22:27:43 AEST 2024


Hi, Sean!

This is from your ANSI module:

:- type aio_state
    --->    aio_state(
                f_colour :: bool,    % Colour or monochrome output?
                f_quiet  :: bool     % All output suppressed?
            ).

:- mutable(astate, aio_state, aio_state(yes, no), ground, [untrailed]).

% ...

:- pragma promise_pure(enable_colours/1).

enable_colours(Mode) :-
    semipure get_astate(aio_state(_, Quiet)),
    impure set_astate(aio_state(Mode, Quiet)).


I'm wondering why you aren't using "attach_to_io_state" and don't make
enable_colours an IO action. You're using the impure get_astate/set_astate
instead. I don't fully comprehend the implications, but this should probably
be avoided.

Cheers,
Volker


Am Samstag, dem 24.08.2024 um 10:38 +0100 schrieb Sean Charles
(emacstheviking):
> I finally made it a library and decided to share it.
> It's probably not 100% efficient but then neither am I, but it works and
> does what I need.
> 
> 
> mercury-libaio.pngemacstheviking/mercury-libaio: Simple ANSI support for
> terminal based
> applications.
> github.com
> 
> 
> 
> Thanks,
> Sean.
> 
> _______________________________________________
> users mailing list
> users at lists.mercurylang.org
> https://lists.mercurylang.org/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20240824/dd36cc70/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mercury-libaio.png
Type: image/png
Size: 130799 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/users/attachments/20240824/dd36cc70/attachment-0001.png>


More information about the users mailing list