|
|
|
|||||
|
Slice identifiers cannot contain underscores?
That seems like a slightly strange restriction. What if I don't like bouncy caps names, or want to use the near ubiquitous "types use bouncy caps", "variables and operations use underscores" convention?
For languages where bouncy caps is the official style, this is fine, but for languages where it is not, like C++, Python, Perl, C and so on it's going to lead to ugly, inconsistent code, and probably violate most organisation's coding style rules. Is there a technical reason to put this restriction in? |
|
|||||
|
This is explained on page 141 of the ICE manual
in the section 4.19.2 CORBA IDL features that are missing in ICE. The paragraph starts with the section: "4. Underscores in identifiers"
__________________
-- Craig Rodrigues |
|
|||||
|
Quote:
But, even so, using this for guaranteed name disambiguation feels like using a sledgehammer to crack a walnut. Every other language I use allows underscores. Not that I've got a better solution, mind you ![]() |
|
||||||
|
Quote:
yes, we considered that too. The problem with this is that double undescores are reserved in C++ for the implementation, so we would tread on the compiler's namespace. I'm afraid that there is no clean solution to this. Whichever way you turn, you find something unpalatable. In the end, banning underscores seemed the cleanest approach -- at least it guarantees that the all valid Slice definitions can be mapped to valid native language code, and removing the underscores doesn't cause ergonomic problems, as name mangling does. Just consider (tongue in cheek): until C came along, the whole world got along just fine in FORTRAN, COBOL, and Pascal without underscores. So, flame away! :-) Cheers, Michi. |
|
||||||
|
Quote:
![]() Quote:
![]() Cheers, Michi. |
|
|||||
|
Quote:
Ken Carpenter |
|
||||||
|
You could disallow underscores as the first letter and use leading underscores in the generated code. Or even simpler, since all Ice* identifiers are reserved, prefix all the generated code by Ice or ice (or _ice etc).
Entirely banning underscores also seems very drastic to me! Cheers, Bernard |
|
||||||
|
Quote:
Moreover, as soon as we permit underscores in Slice, we'd need yet another mechanism to escape generated identifiers in C++. Yes, Ice is reserved already, but we took that step largely to avoid clashes with modules that support the run time, such as Ice and IceInternal. I'm afraid that there really is no good solution to this. Look at it this way: if you consider Ice unusable because Slice identifiers can't contain underscores, there is always CORBA <grin>... Cheers, Michi. |
|
|||||
|
Quote:
However, this stuff just isn't in the documentation, and when you read that clause it just comes across as arbitrary. And that, like Wirth and the infamous Modula-2 keyword rules (*), you're just trying to enforce a stylistic convention onto others. Since most coders are quite sensitive about their code formatting styles, it would be worth a short paragraph right there broadly outlining the reasons that this restriction has been applied ... so that the reader's blood pressure can return to normal levels ![]() (*) if you've used this language, all keywords are in upper case, so that every program you write IS SHOUTING LIKE THIS! The reasoning, I hear, was to make keywords stand out. Guess Wirth just didn't see syntax highlighting editors on the horizon Nice language, apart from that <flame> ... better than C, anyway </flame> |
|
||||||
|
Quote:
Cheers, Michi. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using underscores in Slice variable names. | ctennis | Help Center | 2 | 04-18-2006 01:17 PM |