[grapefruit] Dynamic switching within a collection of signals.

Wolfgang Jeltsch g9ks157k at acme.softbase.org
Sat Jul 18 16:50:38 EDT 2009

Am Samstag, 18. Juli 2009 09:42 schrieb Neal Alexander:
> Is there a way to dynamically switch between signals from a Data.IntMap
> collection for example?
> I could be wrong, but doesn't the current applicative style of 'switch'
> limit you to a pretty small amount of static inputs?
> For example, lets say you have 100 entities roaming around and you want any
> one of their continuous positions to be trackable depending on a switch
> state. Is this an overuse of signals? If not, what options do you currently
> have?

Hello Neal,

it should be possible to switch between 100 different signals with switch. 
However, this might not be very efficient.

Are those 100 entities of a similar kind (e.g., 100 monsters in a video game)? 
Then I wouldn’t use, for example, a set of 100 signals but a single signal 
whose values are sets of 100 entries each. Using incremental signals 
(implemented in the development version of Grapefruit) might be advisable.

I don’t know to what amount this answers your question since I don’t have 
detailed information about your problem. I’d hope to hear from you further.

By the way, could you please send your mails in plain text or at least in 
plain text plus HTML instead of HTML only? If I look at your mails, I only 
see the footer added by the mailing list software. I always have to manually 
switch to HTML to see the actual content. In addition, HTML-only mails might 
not get properly archived by Mailman.

Best wishes,

More information about the Grapefruit mailing list