[m-rev.] for post-commit review: avoid overuse of higher order code

Peter Wang novalazy at gmail.com
Thu Aug 19 10:54:11 AEST 2021


On Wed, 18 Aug 2021 14:48:07 +1000 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> Avoid overuse of higher order code.
> 

> @@ -27,32 +29,39 @@
>  :- type build(T) == build(T, make_info).
>  :- inst build == (pred(in, in, out, in, out, di, uo) is det).
>  
> -    % build_with_module_options(Globals, ModuleName, ExtraArgs, Builder,
> -    %   Succeeded, !Info, !IO).
> +    % build_with_module_options(Globals, ModuleName, ExtraOptions,
> +    %   Build, Succeeded, Info0, Info, !IO):
>      %
> -    % Perform the given closure after updating the option_table in the globals
> +    % Invoke Build given closure after updating the option_table in the globals

Delete "given closure".

> +%---------------------%
> +
> +:- type may_build
> +    --->    may_not_build(list(error_spec))
> +    ;       may_build(list(string), globals, list(error_spec)).
> +            % The globals we have set up for the build,
> +            % all the arguments for the build, and
> +            % any warnings (not errors) we got while updating the globals.
> +            % To the extent that any of these warnings reflect problems
> +            % on the command line supplied by the programmer, they should
> +            % have been reported before we started building any targets.
> +            % Any *other* warnings are the responsibility of (the code
> +            % invoked by) setup_for_build_with_module_options, so
> +            % there is no point in reporting it to the programmer .
> +

Delete the extraneous space.

That looks fine.

Peter


More information about the reviews mailing list