[Bro-Dev] [Proposal] Language extensions for better Broker support

Matthias Vallentin vallentin at icir.org
Tue Jan 3 07:53:21 PST 2017


> >     [result, value] = Broker::lookup(h, 42)  # Returns [Broker::Result, opaque of Broker::Data]
> > 
> >     if ( result == Broker::SUCCESS ) ...
> 
> I would prefer this solution, as it feels more natural coming from other
> languages like python. 

I like it as well because there's no call to status() and the concrete
types of the return variables are irrelevant to the user. (Not only
scripting languages but also C++17 finally introduces "structured
bindings" to support this form of local tuple binding.)

The key question is whether it will only be a one-off or fits more
broadly into the language as part of first-class tuple support. 

    Matthias


More information about the bro-dev mailing list