[Bro] appending to a vector

David Mandelberg david at mandelberg.org
Wed Jun 19 09:36:29 PDT 2013


That works... but there's no redef. I thought normal assignment to a 
const variable was supposed to fail. Isn't that a bug?

On 2013-06-19 12:24, Scott Runnels wrote:
> Hi David, 
>
> I think youre looking for something like this:
>
> const foo: vector of double = vector() &redef;
> foo[|foo|] = 42.0;
>
> print(foo);
>
> v/r
> Scott
>
> Scott Runnels
>
> On Wed, Jun 19, 2013 at 12:14 PM, David Mandelberg
> <david at mandelberg.org [4]> wrote:
>
>> Hi,
>>
>> Whats the recommended way to append to a vector? The documentation
>> says vectors are like tables, so I tried the below code, but it
>> gives
>> some errors.
>>
>> const foo: vector of double = vector() &redef;
>>
>> redef foo += {
>>      [|foo|] = 42.0
>> };
>>
>> print(foo);
>>
>> --
>> David Eric Mandelberg / dseomn
>> http://david.mandelberg.org/ [1]
>> _______________________________________________
>> Bro mailing list
>> bro at bro-ids.org [2]
>> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/bro [3]
>
>
>
> Links:
> ------
> [1] http://david.mandelberg.org/
> [2] mailto:bro at bro-ids.org
> [3] http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/bro
> [4] mailto:david at mandelberg.org

-- 
David Eric Mandelberg / dseomn
http://david.mandelberg.org/



More information about the Bro mailing list