Imperative Notation

Ana Maria Abrao ana@ufu.br
Tue, 09 Feb 1999 19:08:12 -0200


Hi,

I guess people are talking about object IO. A good computer language
must have very general tools and be flexible enough to combine these low
level tools, in order to produce service `a la carte. Like all general
low level tool Object IO library is hard and taste bad when eaten raw.
However, you don't need to eat it raw. "Goto" is a general low level
mechanism of state changing. When used out of the box, Goto produces
nasty code, but it is quite manageable if you encapsulate it in
while...do, or if-then-else. What Nick seems to want is a construct to
encapsulate the library. Clean however is not like a procedural
language, where encapsulation of goto must be achieved by the compiler.
That person must discover a very general mechanism, because it must be
used by everybody. Clean give you means to write mechanisms pret a
porter. 

You can design encapsulations to fit every situation, every user, every
constraint. If you want, you can write something like Haskell's monads.
For instance, I find it quite hard to deal with all the parameters and
complex data structures necessary to draw things in a window. I find it
quite hard not only in clean, but also in Prolog, in ML or in C. In
Clean, however, I can write a combinator who produces a function which
deals with this specific IO tool. After this, I can do all my IO in two
lines. I am not sure whether I made my point clear, but I am convinced
that general mechanisms are always hard to use. Everybody should design
his/her own clean input/output library. Clean Object IO would be the
fabric of these pret-a-porter IO functions.