[Bro-Dev] syntax consistency question

Seth Hall seth at icir.org
Tue Mar 22 19:26:24 PDT 2011

vector of string

Why do these have such differing syntaxes?  I understand that internally vectors are really much more similar to tables than sets, but in usage they're more equivalent to an ordered set than a table (in my mind at least).  If we add FIFO-type operations to vectors so that they're easier to work with, they would feel even more like ordered sets.  For example, using a totally made up code snippet...

global stuff: vector[string] = vector();
enqueue stuff["foo"];
enqueue stuff["bar"];
print |stuff|;
  ==> 2
print dequeue stuff;
  ==> foo
print dequeue stuff;
  ==> bar
print |stuff|;
  ==> 0

Although it's essentially used as a FIFO here, it's still feels sort of set-y.  BTW, this code or something like it working would be awesome. :)


Seth Hall
International Computer Science Institute
(Bro) because everyone has a network

More information about the bro-dev mailing list