[Bro-Dev] #983: Deep typing bug
Bro Tracker
bro at tracker.bro.org
Fri May 10 10:38:40 PDT 2013
#983: Deep typing bug
----------------------+------------------------
Reporter: seth | Owner:
Type: Problem | Status: new
Priority: High | Milestone: Bro2.2
Component: Bro | Version: git/master
Resolution: | Keywords:
----------------------+------------------------
Comment (by jsiwek):
Would it be a reasonable solution to allow some type parameterization on
the container constructors. E.g.:
{{{
type MyRec: record {
min: count &optional;
max: count;
};
print record<MyRec>($min=7, $max=42);
print set<MyRec>([$max=5], [$min=2, $max=10]);
}}}
Otherwise, in an example like that, there's no way to implicitly type the
container/record.
For the original example Seth gave, there should be a way to infer type
from the context of the assignment, but IMO there always seems to be "just
one more case we forgot about" when it comes to automatic record/container
type coercion/promotion/inference...
If it sounds ok to add this feature to the language, does the syntax look
alright with the angle brackets before the constructor param lists?
{{{
record<Type>(...);
set<TypeList>(...);
table<[TypeList], Type>(...);
vector<Type>(...);
}}}
--
Ticket URL: <http://tracker.bro.org/bro/ticket/983#comment:3>
Bro Tracker <http://tracker.bro.org/bro>
Bro Issue Tracker
More information about the bro-dev
mailing list