string vs String

Bill Baxter dnewsgroup at billbaxter.com
Fri Dec 14 04:30:10 PST 2007


Colin Huang wrote:
> Bill Baxter Wrote:
> 
>> Colin Huang wrote:
>>> Janice Caron Wrote:
>>>
>>>> And do you suppose that this would cause no name clashes at all with
>>>> anyone's apps? I imagine it would cause /more/. Anyone who's ever made
>>>> a string class has probably called it "String". To me, the lower case
>>>> s not only ensures fewer name clashes, but also makes it "feel" like a
>>>> primitive type (which it sort of almost is - I mean it's just an
>>>> array, not actually a class or a struct).
>>> Agreed :)
>>>
>>> On an unrelated note, module names starting with uppercase letters (like those in Tango) have always turned me off -- feels too Java-ish to me :P (I remember reading somewhere in the forum that this is done for good reasons, though)
>> Tango names _Packages_ with with capitalized words, but not the modules. 
>>   This allows you to have a module that's the same name as a package. 
>> Like "String.string".  "String" is a package/directory and "string.d" is 
>> a file in that directory.
>>
>> --bb
> 
> Perhaps I'm misunderstanding here, but have a look at the following code
> from tango-bin-win32-CURRENT-dmd.1.022 (in file \import\tango\text\String.d):
> 
> module tango.text.String;
> 
> Isn't this a module with a capitalized name? I'm confused ...

Doh!  I got it backwards.  Sorry.  Anyway the modules and packages have 
different capitalization so that a module and package can have the same 
name.

--bb

--bb



More information about the Digitalmars-d mailing list