[Bro-Dev] functions truly as globals?

Siwek, Jonathan Luke jsiwek at illinois.edu
Mon Sep 30 08:04:00 PDT 2013

> I think that in addition to changing those to const we'd change Bro to not accept creating "global" functions.

You still effectively have global functions if you have a global record w/ a field that is of function type.  Do we do something about that?

> Are there other inconsistencies?

I think more limitations and the current implicit "const" are adding inconsistency and complexity (which comes with more opportunities to bypass in unintended ways).

So I'm trying to understand how immutable do function values have to be.

The actions I think increase consistency are:

1) change most/all "global" function decls in scripts shipped w/ Bro to explicitly use "const"
2) remove the implicit "const" from "global" functions

These should both be easy tasks, but are they actually enough to allow desired optimizations in the compiled-context?  What I didn't get from Robin's comment was if the problem is in what the language *allows* regarding function mutability or in the common *usage* of functions in current scripts?

- Jon

More information about the bro-dev mailing list