When trying to understand this question and answer it, I think it comes
down to "how do I run an arbitrary reporter block not in the context of
anything"

This requires creating a new context, rather than holding on to one.
That would be a safer option than holding on to things.  For instance,
if I have the primitive with the syntax:

test:monitor-of-turtles [ color ]

Where instead of running this command manually multiple times, I want it
to run each time there's a view update (for logging purposes or
something), I would like to get the reporter task and run it.  This
requires a context.  If I keep the ExtensionContext around that the
monitor-of-turtles was created with, that could be invalid upon the next
view update for whatever reason.

So the question is how do I solve this.  I think the answer will be
somewhere in the command center code, but I haven't found it.

Frank

On Fri, Aug 29, 2014 at 10:28:56AM -0700, Seth Tisue wrote:
> When you say "context", do you mean ExtensionContext, or nvm.Context, or 
> what?
> 
> Why is the extension holding onto a context at all? This doesn't strike me 
> as a normal thing to do. I can't say outright it's a wrong thing to do, but 
> I'd need to understand the use case.
> 
> Not sure what you mean by a context being "reset", either.
> 
> You mention listening for ticks. I want to point that it's also possible 
> listen for view-update opportunities, independent of the tick counter.
> 
> Seth
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "netlogo-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to