Imperative Notation

Zuurbier, E. - AMSXE Erik.Zuurbier@KLM.NL
Tue, 9 Feb 1999 12:41:11 +0100


> > Start world
> >     # (_,mbListener,world)              = openTCP_Listener 1888 world
> >       (mbTCPDuplexChan, listener, world)= receive (fromJust mbListener)
> world
> >       (_,{sChan,rChan})                 = fromJust mbTCPDuplexChan
> >       world                             = closeChan listener world
> >       (receivedData, rChan, world)      = receive rChan world
> >       (sChan, world)                    = send sChan receivedData world
> >       world                             = closeChan sChan world
> >       world                             = closeChan rChan world
> >     = world
> 
> I can't be the only person whom this strikes as horrible.
> 
Possibly, but I like the notation.

> Dare I bring up the topic of a "do" notation?
> 
You dare. My own opinion is that I would hate a do-notation. It would make
me nervous to be manipulating
an environment and have no representation of it in my program. I find it one
of the good points of FP
that you can have a representation of anything that you manipulate.

> Regardless. It is a pain to read and write even the most trivial functions
> with this explicit CPS.
> 
I don't agree. To me a few extra references to the environment are a low
price to pay, if they save me
misunderstandings and long sessions of bug-hunting later. *That* is a pain I
almost forgot existed
as they still do in the imperative world.

> I'm sure some nice syntactic solution to the implicit multiple environment
> passing problem could be created.
[..]
> I don't have a proposal [..]
> 
Ensure yourself and design a proposal. Maybe you'll find out it is not so
simple. That would be better
than letting others try to convert you to explicit environment passing. And
if you do come up with a nice
design, that is good too.

Regards Erik Zuurbier