Summary: std.stdio.input() or similar
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos

--- Comment #0 from 2010-08-22 20:02:39 PDT ---
If not already present, a function template similar to this one may be useful
for the std.stdio module. Similar functions are present in Basic and Python

T input(T)(string msg) {
    auto read = readln();
    static if (!is(T == string) && !is(T == dstring) &&!is(T == wstring))
        read = read.strip();
    return to!T(read);

To be used mostly in scripts, as:

double x = input!double("Enter value x: ");

Its name may be changed if there is collision with something different, but it
needs to be simple, given its purpose.

This function may be made much more refined, but I suggest to keep it simple.
Even the static if it contains is more complex than originally thought.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to