Phango

Christopher Wright dhasenan at gmail.com
Sun Nov 18 05:32:47 PST 2007


Alix Pexton wrote:
> Janice Caron wrote:
>> On 11/17/07, Kris <foo at bar.com> wrote:
>>> There's a fair chance the poster below is actually Janice,
>>
>> Who? What?
>>
>> Don't insult me.
>>
>> My opinions - sure - you can insult those. Not a problem there. But
>> don't insult /me/. Ad hominem is just downright offensive.
> 
> I'll say this here, for want of a better place.
> 
> If there were 2 versions of Tango, the current "Offical" version and one 
> like Janice's that comes closer to my own stylistic preferences, and 
> that all the fuctionality was the same, only the identifiers changed, 
> I'd use Janice's version, even if it was a few steps behind in development.

I think it shouldn't be too difficult to arrange an automated system for 
doing that. It could support any number of coding styles. The issue is 
fragmentation: you're using Tango-(phobos style), and I'm using 
Tango-(C# style), and Fredchook's using Tango-(Java style), and we can't 
compile each others' code.

The solution would be using lots of aliases. To some extent, this can be 
accomplished via some CTFE/mixin-based plating, something like:

string phobosAliases(T)() {
    string ret = "";
    foreach (methodName; __traits(allMembers, T)) {
       ret ~= "alias " ~ methodName ~ " " ~ toPhobosCase(methodName) ~ ";\n"
    }
    return ret;
}

class HashMap {
    ...
    mixin phobosAliases!(HashMap);
}


Well, that would be if phobos didn't use the java style for class 
members. Given that the matter is just module-level variables, the 
aliasing will have to be manual. (And case-insensitive imports would be 
nice.) But to support C# style, for instance, such a template would work.

> I don't know how many people find the case issue a sticking point, but I 
> do, and I am reluctant to use a library with such a different style not 
> because it is ugly in its self, but because it clashes with my own 
> style, making my code ugly and unreadable.
> 
> Keep up the good work Janice!
> 
> A...



More information about the Digitalmars-d mailing list