Boris Wang Wrote:

> First, forgive my poor english.
> 
> we all known , Walter good at compiler writing, but not good at language
> design and development management , if can't change this, just be silent.
> 
> I think, on language desgin, wisdom and leadership are more more important
> than technology.
> 
> Ether continue working on D, or make D like clone,  if we can't do it like
> APPLE, just give up ASAP,
> because we can only save us by our selves.
> .
> .
> 
> 
> 
> 2010/11/10 Boris Wang <kona.m...@gmail.com>
Is printing Chinese font in the console under windows now workable?If yes,which 
function under which module should I use?If not,when is it supposed to be?

Is it workable writing a DLL under windows in D2 now?

I read from previous thread that std.xml is supposed to be replace by another 
better one,when?

In TDPL,chap 01,

1.import std.stdio, std.string;   
2.void main()    
3.{   
4.    uint[string] dictionary;   
5.    foreach (line; stdin.byLine())    
6.    {   
7.        // Break sentence into words   
8.        // Add each word in the sentence to the vocabulary   
9.        foreach (word; splitter(strip(line)))    
10.        {   
11.            if (word in dictionary) continue; // Nothing to do   
12.            auto newlD = dictionary.length;   
13.            dictionary[word] = newlD;   
14.            writeln(newlD, word);   
15.        }   
16.     }   
17.}  


The above code is supposed to print each word one time,but after testing by 
myself and my friends on different machine both under windows,it does not.It 
prints some of the words several times,but some are ok.One of my friend 
suggested to modify the code as below:

1.foreach(line;stdin.byLine())     
2.{   
3.    line = line.dup;   // <-------------------------- here   
4.    foreach(word;splitter(strip(line)))     
5.    {     
6.        if(word in dictionary) continue;     
7.        auto newID=dictionary.length;     
8.        dictionary[word]=newID;     
9.        writeln(newID,'\t',word);     
10.    }     
11.}   

Still it behaves different on different machine under windows.

Reply via email to