V3.4 & general: A thought on map/zone parameter in functions

I notice that new functions such as Count() have two forms. For example,

Count(expr) - counts across all maps
Count(expr, map ) - counts on specified map

Perhaps, this is a general format already too well established in Vassal to go against, but it occurs to me that it would be more safe for module performance in general and flexibility of use, if the default [e.g. Count(expr)] was just to operate on the current map. And (perhaps this already works, I have not tried), if the fully qualified version would accept a regular expression that would be pattern-matched against all maps (assuming that it contained a wild-card specification).

Just an idea…

PS Count() in particular is proving very handy to me and I am finding performance very acceptable. In my application so far, I am able to limit the target pieces by area (e.g. Location and Zone) and I guess this helps.

Indeed, the combination is quite good, if you work with multiple maps and identically named zones on them.

I have different colored labs (as named maps), each of which has 2 or more named zones :
Count("{CurrentZone==\"Base Elements\"}","Red Lab")
This could also be used with another trait, like a marker nature==“base element”

My guess is that this won’t take as many system resources to count from a specific map as from the whole module.