Hey all, I'm going over some examples in Alexandrescu's book, but I guess
something has changed in the language because the example isn't working for me.
The simple example:
void main(string[] args)
{
uint[string] freqs;
foreach(lines; stdin.byLine()) {
foreach(word; split(strip(lines))) {
++freqs[word.idup];
}
}
foreach(key, value; freqs){
writefln("%6u\t%s", value, key);
}
din.getc();
}
This throws an error during compile, like:
main.d(11): Error: no property 'ByLine' for type '_iobuf'
main.d(11): Error: function expected before (), not 1 of type int
main.d(11): Error: foreach: int is not an aggregate type
So seemingly byLine is no longer an existing function on stdin. What is the
current version of what this code is trying to do?