[Bro-Dev] set and vector operators
jsiwek at corelight.com
Mon Apr 30 08:10:03 PDT 2018
On 4/30/18 9:10 AM, Vern Paxson wrote:
> The question then was what would be the new "v op e" syntax.
> The best we could come up with (which we both found not-too-awful) is
> "vector(v op e)". Wrapped in "vector(...)", the operation becomes the
> current semantics (apply "op e" separately to each element of v).
Maybe "vectorize(v op e)" ?
Implies implementing via SIMD instructions.
> "v op e" by itself would now be an error (which could point the user
> at the "vector(...)" syntax as possibly providing what they're looking
> for). "v += e" would be "append e to v".
That still seems odd to me. If "v += e" means "append", then I might
expect "v + e" to do the same, except producing a new value w/ original
vector not modified.
Maybe that's a less common use-case, though, and so "v op e" being an
error would be less weird than suddenly changing the meaning of that
More information about the bro-dev