[Issue 5600] New: rdmd: Broken behavior with command-line input

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 16 13:43:09 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5600

           Summary: rdmd: Broken behavior with command-line input
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2011-02-16 13:40:34 PST ---
This is as odd as it gets. In Windows command-line:

> type math.d
module math;
import std.stdio;
import core.stdc.stdio;
import std.conv;
import std.string;

string prompt = "Enter a number: ";
int input;

void main()
{
    write(prompt);
    auto result = to!int(readln().strip);

    writeln(result);
}

I run the test module via rdmd, and enter 45:
> rdmd math.d
D:\dev\code\d_code\bugs>Enter a number: 45
'45' is not recognized as an internal or external command,
operable program or batch file.

Now I thought I'm back to command line, but it appears I'm somehow still "in"
rdmd mode:
D:\dev\code\d_code\bugs>test
std.conv.ConvException: std.conv(727): Can't convert value `test' of type
const(char)[] to type int
std.conv.ConvException: std.conv(1129): Can't convert value `test' of type
const(char)[] to type int

Finally I'm back to command line
>test
'test' is not recognized as an internal or external command,
operable program or batch file.
D:\dev\code\d_code\bugs>

Using DMD, this test module works fine:
> dmd math.d
> math.exe
Enter a number: 34
34

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list