[m-rev.] for review: more disambiguations

Zoltan Somogyi zs at csse.unimelb.edu.au
Wed Sep 20 19:30:32 AEST 2006


On 20-Sep-2006, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> >    %
> >    % Reads a term from the current input stream. The string is the 
> >    filename
> >    % to use for the current input stream; this is used in constructing the
> >    % term.contexts in the read term. This interface is used to support
> >    % the `:- pragma source_file' directive.
> >    %
> >-:- pred read_term(string::in, read_term(T)::out, io::di, io::uo) is det.
> >+:- pred read_term_filename(string::in, read_term(T)::out, io::di, io::uo)
> >+    is det.
> 
> I think read_term_from_file would be a more appropriate name.  The
> comment above that one looks wrong as well: it isn't reading the
> term from the current input stream, it's reading it from the named
> file.

No, as far as I can tell it is reading from the current stream. The argument
merely tells the parser what filename to put in the contexts of the terms
it constructs. Given that, read_term_from_file would be misleading.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list