[mercury-users] About functional notation and IO

Gustavo A. Ospina gos at info.fundp.ac.be
Mon Jun 14 23:08:39 AEST 1999


Hi.

Possibly this is an older matter, since Ralph Becket has already mentioned
this, but, just to know...

Will be there in the future versions of list__map and higher order
predicates with functional notation? I know is relatively easy to use the
actual versions with predicates "lambda" (perhaps this be an heresy)
calling functions, but with this would be even more natural.

Possibly this is another older matter, I remember this is already discuted
before, but, just to dare putting an idea...

Could be an alternative to use DCG notation the use of a pragma to declare
predicates "that will use IO", and to hide the parameters "state of world"?
It would be something like this fool example.

:- pred hi(io__state :: di, io__state :: out) is det.

hi -->
	io__write("Hi").

% This is my idea
:- pragma io_pred hi.
:- pred hi is det.

hi :-
	io__write("Hi").

The main idea is eliminate the confusing use of DCG and the {}, cause of
many ocasional (but easy to fix) errors in compiling. Predicates using IO
would be distinguished by the pragma declaration, which would make
unnecessary the use of {}. In my view, the declarative semantics of IO is
not altered. The notation DCG would be allowed too.

I guess this topic has been largely discussed, but I just want to know
really what was the best decision that you could take to this respect. In
my practice, now I'm accustomed to use the parameters io__state, even being
them a little boring.

Best luck and happiness.

+ Gustavo.

--------------------------------------------------------------------------
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