[m-dev.] string streams and formatting

Michael Day mcda at cat.cs.mu.OZ.AU
Mon Jan 17 16:23:41 AEDT 2000


> >     1.  binary
> >     2.  term
> > 	a.  machine readable (output is guaranteed to be readable by the
> > 	    appropriate read predicate)
> > 	b.  human readable (may include type-specific output formats,
> > 	    may be depth-limited, etc.)
> > 	c.  formatted output (with field widths, radix setting,
> > 	    paragraph filling, etc, all controlable for individual
> > 	    components)
> > 	d.  displayed (operators not respected, like display/1 in Prolog)
> >     3.  graphical (text is printed with different fonts, bitmaps are
> >         displayed, constructors are provided for laying out
> > 	collections of these things, etc.)
> > 
> > and no doubt more.  I think each of these really needs to have a
> > different predicate (or type class method) name.
> 
> Just to summarize the current names that the standard library uses for these:
> 
> 	1.	io__write_binary (and io__read_binary)
> 	2.a.	io__write (and io__read)
> 	2.b.	io__print

And to summarize the proposed stream formatting:

	1.	write(binary(T))
	2.a.	write(text(T))
	2.b.	 - no proposal yet -
	2.c.	write(centre(.., write(right(.. and so forth
	2.d.	 - no proposal yet -

I could change `binary' and `text' back to `binary_term' and `text_term'
if it is felt to be clearer.

Not knowing `display' in Prolog I have not proposed it, if not respecting
operators means it writes them out without applying them, I don't see how
I can do that in Mercury.

Note: write is not a standard library predicate. It is a type class
method. I've said this a few times now, but I get the feeling that it is
thought I have some horrendous write predicate that somehow does
*everything*... maybe I'm just being paranoid.

Michael

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list