enum namespacing

Does it makes sense that an enum would be in the name space it's declared within even if it's extending an enum type from another namespace?

My example:

module Software;

export {
  type Type: enum { UNKNOWN };
}

module HTTP;

redef enum Software::Type += { WEB_SERVER };

event bro_init()
  {
  # I would expect this to be true, but it seems that WEB_SERVER was placed into the HTTP namespace and this doesn't work.
  print Software::WEB_SERVER;
  }

  .Seth

Does it makes sense that an enum would be in the name space it's declared
within even if it's extending an enum type from another namespace?

Huh. I have a nagging sense that there's no correct answer to this one
... However, the behavior you show matches what seems to me more likely
to accord with Principle Of Least Surprise.

    Vern

Fair enough. I'll have to think about how this some more then.

  .Seth

Note that currently the NOTICE framework is the part the mostly makes
use of extended Enums and there it makes sense for the extended elements
to live in the enclosing name-space (in your example HTTP).

I guess the current rule is: if an identifier does not have a Foo::
module specifier, it's placed in the current module. So,

module HTTP;
redef enum Software::Type += { Software::UNKNOWN }; # UNKNOWN in
                                  Software namespace
redef enum Software::Type += { UNKNOWN }; # unknown in HTTP namespace

just my 2ct
Gregor

This is what would seem to make the most sense to me, but doesn't seem to be true currently.

  .Seth

module HTTP;
redef enum Software::Type += { Software::UNKNOWN }; # UNKNOWN in
                                 Software namespace
redef enum Software::Type += { UNKNOWN }; # unknown in HTTP namespace

This is what would seem to make the most sense to me, but doesn't seem to be true currently.

Huh. I thought that's what it was doing. At least that's what I thought
your mail said. I must have misunderstood it.
Can you briefly explain the current behavior?

thx
gregor