On Fri, Apr 19, 2013 at 18:15 +0000, you wrote:
> Provided that &default for tables is not supposed to modify table > membership when accessing indices that don't exist, I'm wondering if it should modify the table here. I can see how the current behaviour is misleading, it violates the "principle of least surprise". :) Can we change tables so that if &default is a non-constant, the first time one accesses a non-existing index, that slot gets assigned a deep-copy of the &default value? The downside would be that if somebody is relying on the current behaviour, he might access lots of non-existing entries with the assumption that the table won't change (i.e., he won't run into memory trouble). An alternative would be to have the lookup return a copy of the default, but not modify the table. With that "foo[0]$x = 0" would still not work as expected, but at least it wouldn't have any surprising side effects. Robin -- Robin Sommer * Phone +1 (510) 722-6541 * [email protected] ICSI/LBNL * Fax +1 (510) 666-2956 * www.icir.org/robin _______________________________________________ bro-dev mailing list [email protected] http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev
