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

Matthias Vallentin vallentin at icir.org
Mon Jan 2 11:46:27 PST 2017


> Alternatively, we could leave it to frameworks to define their own
> error types. So for Broker, we'd have Broker::NotFound,
> Broker::Timeout, etc. And the opaque types would define internally
> what they convert to, and how.

It looks like this is the model you went with in the revised proposal.
For better modularity, that's also the model I'd prefer.

> >     if ( status(v) == Broker::SUCCESS )
> 
> Thinking more about this, I kind of like this version actually, and
> have for now included that into the proposal. Curious to hear what
> others think about this. It would be an easy solution actually.

I'm not sure if it's a typo or not, but your code example has a new,
so-far not discussed form of type castin: T to x. For example: 

    case bool to b:      # Make the boolean available as "b".
        print "bool", b;
        break;

That would mean we'd have new keywords: is, to, as. I find that's too
confusing and think we should go with either "to" or "as" but not both.

    Matthias


More information about the bro-dev mailing list