[mercury-users] io__write_list

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Thu Nov 7 18:25:02 AEDT 2002


* Noel  Pinto <cool4life at rediffmail.com> [2002-11-07 08:15]:
> Hi,
> 
> The syntax for io__write_list is
> io__write_list(List, Separator, Outpred, IO0, IO).
> 
> It says that OutPred is applied to each element of the list.
> 
> Plz tell me what is OutPred?

You may find it useful to read the full predicate declaration of
io__write_list as found in de library documentation: 

:- pred io__write_list(io__output_stream, list(T), string, 
	pred(T, io__state, io__state), io__state, io__state).
:- mode io__write_list(in, in, in, pred(in, di, uo) is det, di, uo) 
	is det.
:- mode io__write_list(in, in, in, pred(in, di, uo) is cc_multi, di, uo)
	is cc_multi.
	% io__write_list(Stream, List, Separator, OutputPred, IO0, IO)
	% applies OutputPred to each element of List, printing Separator
	% between each element. Outputs to Stream.

>From the pred and mode declaration you should, by now, be able to deduce
that "OutputPred" is supposed to be a "pred(T, io__state, io__state)",
with modes "pred(in, di, uo)"... 

Nancy
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list