[m-dev.] bugfix and enhancement to io.m

Fergus Henderson fjh at cs.mu.oz.au
Mon May 26 16:02:03 AEST 1997


Thomas Charles CONWAY, you wrote:
> 
> 	Make io__read_binary/4 set the io__stream correctly.

Oops, thanks for fixing that.

>         added two new predicates:
>                 io__seek_binary/5 which interfaces to fseek
>                 io__binary_stream_offset/4 which interfaces to ftell
>         Make io__binary_*_stream concrete type equivalences to
>         io__binary_stream. This is to overcome the problem that operations
>         like the two new ones above are used on both input and output
>         streams, and this seems to be the best way to overcome the
>         subtyping problem at this stage.

That looks good.  One small comment:

> +:- pred io__seek_binary(io__binary_stream, io__whence, int,
> +		io__state, io__state).
> +:- mode io__seek_binary(in, in, in, di, uo) is det.
> +%	Seek to an offset relative to Whence (documented above)
> +%	on a specified binary stream. Attempting to seek on a
> +%	pipe or tty results in implementation defined behaviour.

"Implementation defined behaviour" means behaviour that the implementation
must document.  Since the Mercury User's Guide doesn't document the
behaviour in this case, I suggest you change it to "implementation
_dependent_ behaviour".

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list