[m-rev.] diff: Remove many io module prefixes in io.m

Paul Bone paul at bone.id.au
Thu Aug 25 11:50:28 AEST 2016


On Wed, Aug 24, 2016 at 05:06:43PM +1000, Julien Fischer wrote:
> 
> Hi Paul,
> 
> On Wed, 24 Aug 2016, Paul Bone wrote:
> 
> >Remove many io module prefixes in io.m
> >
> >This change removes many unambiguous module prefixes.  Specially those in
> >the head or declaration of a predicate or function.  But also those within
> >bodies that are unambiguous, both for the compiler and humans.
> >
> >library/io.m:
> >   As above.
> >---
> >library/io.m | 1711 +++++++++++++++++++++++++++++-----------------------------
> >1 file changed, 851 insertions(+), 860 deletions(-)
> >
> >diff --git a/library/io.m b/library/io.m
> >index 371ca93..6066d7e 100644
> >--- a/library/io.m
> >+++ b/library/io.m
> >@@ -112,14 +112,14 @@
> >    ;       eof
> >    ;       error(string, int). % error message, line number
> >
> >-:- type io.error.   % Use error_message to decode it.
> >+:- type error.   % Use error_message to decode it.
> 
> Personally, I find that clearer if that's left qualified.
> 
> >
> >    % Poly-type is used for write_many and format,
> >    % which do printf-like formatting.
> >    %
> >-:- type io.poly_type == string.poly_type.
> >+:- type poly_type == string.poly_type.
> 
> Ditto with that one.  Uses of that one need to be qualified in any case
> (in order to avoid the ambiguity that results with string.poly_type.)

I was on the fence about these.  I'm happy to add the qualifier back on.

> I would actually be in favour of deleting the equivalence io.poly_type/0
> entirely.  (That may break existing things, but only in a very minor
> way.)

I'll test to see how much breaks.  In any case it's a seperate change.


-- 
Paul Bone
http://paul.bone.id.au


More information about the reviews mailing list