D-Bus Spec change: dashes in interface names

Havoc Pennington hp at redhat.com
Sun Oct 15 13:33:12 PDT 2006


Hi,

I did think of another issue, which is that many programming languages 
allow underscore but not hyphen in identifiers. I think that's also why 
dbus doesn't allow starting things with a number (if I remember right 
that it doesn't allow that).

Thiago Macieira wrote
> On the other hand, you have a point with Java. I'd more important to be 
> consistent. If the Java developers are used to replacing '-' with '_', it 
> should be ok for us too.

Google turns up this:
http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html

> In some cases, the internet domain name may not be a valid package name. Here are some suggested conventions for dealing with these situations: 
> 
> If the domain name contains a hyphen, or any other special character not allowed in an identifier (§3.8), convert it into an underscore. 
> If any of the resulting package name components are keywords (§3.9) then append underscore to them. 
> If any of the resulting package name components start with a digit, or any other character that is not allowed as an initial character of an identifier, have an underscore prefixed to the component. 

I'd lean a bit toward leaving things as they are, I guess. Maybe docs 
similar to the above should be in the spec though.

Havoc


More information about the dbus mailing list