[Bro-Dev] Pattern matching for the Bro language

Vern Paxson vern at icir.org
Wed Aug 19 12:09:01 PDT 2015

> I want to propose introducing pattern matching for the Bro language.

Per our discussion yesterday, I like this notion in general.  (Seems we
need a better term for it, though, as "pattern matching" is very generic -
plus will confuse some people who'll think it refers to NIDS rules rather
than generic type safety!)

> Some languages (Ruby comes to mind) design switch as an expression,
> which would allow constructs like:
>       local result = switch( x )
>         {
>         case T:
>         case U:
>         };

Personally, this strike me as a tad weird, since now "result" might not
have a statically determined type, so we're back to it being "any".
So I'd want to wait on going this far until we have use cases where
it clearly would help with code clarity.


More information about the bro-dev mailing list