We generally try to allow lispy names to be used while actually targeting C code, that is, we translate foo-bar to foo_bar. However, if I mix those two, that is, use foo-bar and foo_bar in my code, our name-fixing pass does the right thing for the identifier that is encountered first, but the second one will have a suffix _ attached to it.
This is sensible as we might have vastly different names mapping to the same C representation, but for this case I think it causes more confusion than it resolves. Think, e.g., about two people using push_back (from vector) inconsistently.
More problematic, I think, is that duplicates are also generated for the symbols of the same name, but from different packages. An example would be having a macro (from a library) that uses push-back be expanded in user code that uses push_back. In this case either one of the two will break. This causes all sorts of name-conflicts for libraries with code-generating macros.
I would argue to resolve those by allowing symbols to be equal in a broader sense, that is ignore - and _ differences and (more importantly) ignore packages for the translation.
We generally try to allow lispy names to be used while actually targeting C code, that is, we translate
foo-bar
tofoo_bar
. However, if I mix those two, that is, usefoo-bar
andfoo_bar
in my code, our name-fixing pass does the right thing for the identifier that is encountered first, but the second one will have a suffix_
attached to it.This is sensible as we might have vastly different names mapping to the same C representation, but for this case I think it causes more confusion than it resolves. Think, e.g., about two people using
push_back
(from vector) inconsistently.More problematic, I think, is that duplicates are also generated for the symbols of the same name, but from different packages. An example would be having a macro (from a library) that uses
push-back
be expanded in user code that usespush_back
. In this case either one of the two will break. This causes all sorts of name-conflicts for libraries with code-generating macros.I would argue to resolve those by allowing symbols to be equal in a broader sense, that is ignore
-
and_
differences and (more importantly) ignore packages for the translation.What do you think, does this sound reasonable?