Thread overview
Bug in Rdmd?
Jun 14, 2016
Jonathan Marler
Jun 14, 2016
Jeremy DeHaan
Jun 14, 2016
Jonathan Marler
Jun 14, 2016
Adam D. Ruppe
Jun 14, 2016
Jonathan Marler
June 14, 2016
This code doesn't seem to work with rdmd.  Is this a bug?

  import std.stdio : byLine;
  int main(string[] args)
  {
    foreach(line; stdin.byLine) {
    }
    return 0;
  }

Compiler Output:
  Error: module std.stdio import 'byLine' not found
June 14, 2016
On Tuesday, 14 June 2016 at 01:05:46 UTC, Jonathan Marler wrote:
> This code doesn't seem to work with rdmd.  Is this a bug?
>
>   import std.stdio : byLine;
>   int main(string[] args)
>   {
>     foreach(line; stdin.byLine) {
>     }
>     return 0;
>   }
>
> Compiler Output:
>   Error: module std.stdio import 'byLine' not found

Try removing the 'byLine' from the import statement. The error message looks like it can't find the function 'byLine' in the std.stdio module. It isn't a free function, but one of File's methods.
June 14, 2016
On Tuesday, 14 June 2016 at 01:35:32 UTC, Jeremy DeHaan wrote:
> On Tuesday, 14 June 2016 at 01:05:46 UTC, Jonathan Marler wrote:
>> This code doesn't seem to work with rdmd.  Is this a bug?
>>
>>   import std.stdio : byLine;
>>   int main(string[] args)
>>   {
>>     foreach(line; stdin.byLine) {
>>     }
>>     return 0;
>>   }
>>
>> Compiler Output:
>>   Error: module std.stdio import 'byLine' not found
>
> Try removing the 'byLine' from the import statement. The error message looks like it can't find the function 'byLine' in the std.stdio module. It isn't a free function, but one of File's methods.

It actually is a free function (not a method on the File object). 
 This works if you compile it with dmd, just not with rdmd.

June 14, 2016
On Tuesday, 14 June 2016 at 03:15:04 UTC, Jonathan Marler wrote:
> It actually is a free function

no, it isn't, it is on File.

Your code doesn't compile on my dmd (and indeed it shouldn't on yours either unless you have a version mismatch. rdmd just calls dmd, it doesn't produce its own errors)
June 14, 2016
On Tuesday, 14 June 2016 at 03:40:01 UTC, Adam D. Ruppe wrote:
> On Tuesday, 14 June 2016 at 03:15:04 UTC, Jonathan Marler wrote:
>> It actually is a free function
>
> no, it isn't, it is on File.
>
> Your code doesn't compile on my dmd (and indeed it shouldn't on yours either unless you have a version mismatch. rdmd just calls dmd, it doesn't produce its own errors)

Shoot stupid mistake.  You were right Jeremy and Adam.  Thanks for replying and showing me my silly error.  I could have sworn byLine was a template and calling it with file was just UFCS...and I don't know how I was able to compile that with DMD...must have made a mistake somewhere.  Thanks again.