eliminate writeln et comp?

Alexander Pánek alexander.panek at brainsware.org
Thu Mar 19 03:47:37 PDT 2009


Andrei Alexandrescu wrote:
> Denis Koroskin wrote:
>> On Wed, 18 Mar 2009 03:26:16 +0300, Andrei Alexandrescu 
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> Denis Koroskin wrote:
>>>> That's not a very frequent operation. In most cases you should use 
>>>> Cout("Hello"); instead. An ideal design solution, imo (fast, short 
>>>> and clear).
>>>
>>> Interesting. Should I do the same in phobos?
>>>
>>> stdout("wyda");
>>>
>>> I'd like that particularly because write() is too common a name to 
>>> place at namespace level for my taste. So then we'd have:
>>>
>>> stdout("wyda"); // no newline
>>> stdout("wyda\n"); // newline but no flushing on binary stream
>>> stdout("wyda", newline); // write'n'flush
>>> stdout.writeln("wyda"); // same
>>>
>>> If we go that route I'll even drop writeln and rely on passing 
>>> newline. For formatting there'd be stdout.format and stdout.formatln 
>>> or something.
>>>
>>
>> This is funny because Tango has adopted exactly the same design.
> 
> Well it isn't funny. It's obvious: you just told me about it! :o)
> 
>> The only difference is that Stdout is written in upper case:
>>
>> import tango.io.Stdout;
>>
>> void main() {
>>    Stdout("Hello, World\n"); // no flushing
>>    Stdout("Hello, World").newline; // new line appended, flushs
>>    Stdout.format("Hello, {}!", "Andrei").newline; // formatting
>>    Stdout.formatln("Hello, {}!", "Kris");
>> }
>>
>> It would be great if the two libraries share the same interface.
> 
> Ionno. In Phobos, types are Capitalized, values are camelCase or 
> justminuscules.
> 
>> BTW, since you are in process of redesigning of Phobos IO/stream 
>> system, it would be great if you take a look at the Tango IO system, 
>> first. I recall you telling that you didn't give a good look at Tango, 
>> so now is the time. I particularly insist on talking to Kris about it; 
>> perhaps, he has some ideas on the topic. He may also share experience 
>> with you (errors he made etc). I'll give you a few ideas of mine in a 
>> separate post.
> 
> I don't know about licensing issues, and last thing I need would be to 
> be accused of stealing from Tango.
> 
>> You shouldn't avoid looking on someone's code, especially if it may 
>> help D get better standard library. There's nothing wrong with 
>> borrowing ideas from others, too, especially if they give you a 
>> permission for that. Tango is dual-licensed under Academic Free 
>> License v3.0 and BSD License, so there might not be a need to, but 
>> anyway.
> 
> I have zero knowledge of licensing stuff, but I understand Walter does. 
> He's not looking at Tango so nor should I. I'm sure it has some cool 
> ideas, but so do other libraries.

You know, this is just counter-productive. There are several people - 
all of them very valuable members of the D community, with countless 
contributions - who have put forth a library with its goals being mainly 
the success of D and especially a vital, alive development process. This 
library is available licensed under BSD, which basically means you can 
do whatever you please with it, as long as you don’t remove the 
copyright of the original authors.

Now, what you’re doing is despite the fact that the Tango sources are 
completely free and available to you, deny any kind of insight you might 
be able to gather in there. Why? If you’re responsible for the standard 
library and you *do* take ideas from Tango and integrate them into the 
official standard library, you’re doing every Tango dev a big favour. 
Because, you know, that’s why there is Tango. You didn’t forget that, 
did you?

No offense intended, of course. I just think you should really 
reconsider your decision to not look at Tango, based on facts. Not based 
on “I  might step on someone’s toes because of I don’t know why.”

Kind regards,
Alex

PS: Pretty please, don’t get me wrong, I really appreciate your 
contributions to D! :)



More information about the Digitalmars-d mailing list