[m-rev.] for post-commit review: io.environment.m and io.call_system.m

Peter Wang novalazy at gmail.com
Tue Mar 8 11:04:59 AEDT 2022


On Tue, 08 Mar 2022 09:37:29 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> The decision to carve these submodules out of io.m has been
> agreed, and the mechanics are straightforward, so this is for
> post-commit review by anyone.
> 
> All the moves of predicates to other modules that we have agreed to
> a few days ago are done as of this change. The size of io.m
> has been reduced from about 13,200 lines to 11,200 lines,
> which is significant, but far from enough. So the I think
> we (I) should go ahead and move the implementations
> of the main I/O predicates (open/close, io.write_X etc)
> to submodules, though this time these will be private
> (non-user-accessible) submodules, and the declarations
> of the predicates involves will remain in io.m, and won't be
> marked obsolete. Does anyone object?
> 
> If not, I actually plan to start by moving the internal error
> handling code to a new undocumented submodule, named
> probably io.error, since all the other new private submodules
> will need access to that functionality. (My original proposal
> about breaking up io.m considered only the documented part
> of its interface; io.m has a second interface section that does not
> end up in the documentation, which declares quite a few predicates.)

No objection from me.

> diff --git a/library/io.call_system.m b/library/io.call_system.m
> index e69de29bb..0c319eb72 100644
> --- a/library/io.call_system.m
> +++ b/library/io.call_system.m
> @@ -0,0 +1,267 @@
> +%---------------------------------------------------------------------------%
> +% vim: ft=mercury ts=4 sw=4 et
> +%---------------------------------------------------------------------------%
> +% Copyright (C) 1993-2012 The University of Melbourne.
> +% Copyright (C) 2013-2022 The Mercury team.
> +% This file is distributed under the terms specified in COPYING.LIB.
> +%---------------------------------------------------------------------------%
> +%
> +% File: io.call_system.m.
> +%
> +% This module provides predicates to invoke commands via the shell
> +% of the underlying operation system.
> +%
> +%---------------------------------------------------------------------------%
> +%---------------------------------------------------------------------------%
> +
> +:- module io.call_system.
> +:- interface.
> +

You can also move io.decode_system_command_exit_code to
io.call_system.m.

> diff --git a/library/io.environment.m b/library/io.environment.m
> index e69de29bb..897882efd 100644
> --- a/library/io.environment.m
> +++ b/library/io.environment.m
> @@ -0,0 +1,349 @@
> +%---------------------------------------------------------------------------%
> +% vim: ft=mercury ts=4 sw=4 et
> +%---------------------------------------------------------------------------%
> +% Copyright (C) 1993-2012 The University of Melbourne.
> +% Copyright (C) 2013-2022 The Mercury team.
> +% This file is distributed under the terms specified in COPYING.LIB.
> +%---------------------------------------------------------------------------%
> +%
> +% File: io.environmentm.

Typo.

> +%---------------------------------------------------------------------------%
> +%---------------------------------------------------------------------------%
> +
> +:- implementation.
> +
> +% ZZZ
> +:- import_module assoc_list.
> +:- import_module pair.

ZZZ left here.

The rest is fine.

Peter


More information about the reviews mailing list