Dear Raphael,

Here is a common use-case where some functor has observable state: if you have an application that supports a number of configuration settings, then you might want to store these settings in some stateful data structure, so they can be changed at any time.

If you now use this application in multiple independent OPI buffers (a common scenario if you really work with your application), then you run into the problems I described.

Best
Torsten

On 30 Jun 2009, at 15:47, Raphael Collet wrote:

Dear Torsten,

On Tue, Jun 30, 2009 at 4:14 PM, Torsten Anders <[email protected]> wrote:
On 30 Jun 2009, at 14:01, Raphael Collet wrote:
This happens all the time when you use the OPI, if you reload a module with Module.link without having stopped the emulator. The former loaded module becomes out of lexical scope, and may be garbage collected.

I see, of course.

So, just to summarise: you would argue that few people ran into problems with re-linking the same functors multiple times, therefore no additional procedures are needed for Mozart?

I never ran into such problems. The reason is simple. I know two cases where a module has some internal state. The first one is the case of Mozart internal modules (like DP), and those use some tricks to not be applied twice.

The other case is a regular application module. But in that case, I unconsciously design my application to avoid linking such a module twice. Mozart sort of encourages good design ;-)

Anyway, I am not against adding a "permanent" module manager besides Module.link.

Cheers,
raph

--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-586219
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de



_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to