[Bro-Dev] Use of 'any' type

Jim Mellander jmellander at lbl.gov
Thu Aug 16 13:40:16 PDT 2018

It would be most convenient if the 'any' type could defer type checking
until runtime at the script level.

For instance, if both A & B are defined as type 'any', a compile time error

"illegal comparison (A < B)"

occurs upon encountering a bro statement

if (A < B) do_something();

even if the actual values stored in A & B at runtime are integral types for
which comparison makes sense.

If the decision could be made at runtime (which could then potentially
throw an error), a number of useful generic functions could be created at
the script level, rather than creating yet-another-bif.  A useful
yet-another-bif would be 'typeof' to allow varying code paths based on the
type of value actually stored in 'any'.

Any comments?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.icsi.berkeley.edu/pipermail/bro-dev/attachments/20180816/82f81747/attachment.html 

More information about the bro-dev mailing list