Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] exene and ocaml ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: briand@a...
Subject: Re: [Caml-list] exene and ocaml ?
>>>>> "Ville-Pertti" == Ville-Pertti Keinonen <will@exomi.com> writes:

  >> Simple: there is no stack. Event handlers have to return, and
  >> when they do the stack is lost.

  Ville-Pertti> In Brian's specific example as I understood it, this
  Ville-Pertti> would not be relevant.

Yes I think it would be.  My example was just not very good.

Let's say you have a drawing program with different drawing tools.
Each tool must have local state as it constructs it's respective
graphic object.  If the different events all invoke the procedure
separately, then that state _must_ reside outside of the routine.

In addition, if something happens to change state, i.e. the drawing tool is cancelled, there is no other way to communicate that other than by some sort of global variable.

It may be possible to adress these problems through the use of
modules, but the fact remains, that I can come up with a _much_
cleaner implementation with a persistent procedure than I can with a
standard event model.

As always, there is more than one way to do it, and certainly I can
get things done in the event model approach, but I think it's a
kludge.

Thanks for you comments.

Brian

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners