[Bro-Dev] set and vector operators

Jon Siwek jsiwek at corelight.com
Mon Apr 30 08:21:43 PDT 2018



On 4/30/18 9:54 AM, Robin Sommer wrote:

> One additional piece of context here: That vector(...) syntax could
> then be used more broadly in the sense of creating a different
> semantic context for the operations inside. That kind of opens up a
> whole new set of of type-specific operator meanings, without affecting
> current/standard ones (it's like introducing R inside parentheses :-).

Yeah, framing it as type-specific operators makes sense.

> It's not the super-great, but at least it's explicit and we couldn't
> come up with anything better if we want to have such operations as
> operators. Might work for some other types as well.

Isn't the existing "v + e" an alternative that one could say is "better" 
?  Other languages also take that to mean "vectorized/array operation".

I think for Bro, it's just that vectorized/array operations will be a 
less common use-case than appending and so there's incentive to make the 
later more succinct?

Just to put it out there again: I wouldn't mind something like 
"append(v, e)" and leaving the existing vector operations like "v + e" 
alone.  It may make the common case more verbose, though there's also 
less ambiguities.

- Jon


More information about the bro-dev mailing list