[mercury-users] Event handling in mercury

Ralph Becket rbeck at microsoft.com
Mon Jul 16 21:18:11 AEST 2001


> From: Holger Krug [mailto:hkrug at rationalizer.com]
> Sent: 16 July 2001 08:12
> 
> The main control structure of contemporary application programs,
> distinguished by more or less complicated graphical user interfaces,
> is the event loop. In mercury-extras/graphics/samples/calc/ the event
> loop is implemented in a rather crude way, not acceptable for industry
> use:
> 
> After each event occurring the changed application state is forwarded
> to each of the widgets by redefining the event handler for every
> possible future event.
> 
> This seems to be as well an unnecessarily strange coding style as also
> highly inefficient, at least in a strict language like mercury.

At a guess, I'd assume the calc code was written to avoid using the
globals slot on the io__state (see io__{get,set}_globals) which could
have been used to avoid the problems you mention.

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