[phobos] readf for the novice
Andrei Alexandrescu
andrei at erdani.com
Tue Sep 14 07:29:51 PDT 2010
I think that's useful functionality, but it doesn't strike me as an API
belonging to the standard library.
Andrei
On 09/11/2010 04:41 PM, Jesse Phillips wrote:
> There was a newsgroup post on this subject the beginning of this month
> and it didn't get much feedback, other than a couple "sounds good to
> me"
>
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=115470
>
> I offered to clean up my implementation. There are some things I need
> to experiment with and choose what would be best. And most importantly
> I need to find out if it would be considered a good addition to
> Phobos. The below code is an example of the functions and their usage:
>
> import std.interact;
>
> void main() {
> auto age = userInput!int("Please Enter you age");
>
> if(userInput!bool("Do you want to continue?"))
> {
> auto outputFolder = pathLocation("Where you do want to place
> the output?");
> auto color = menu!string("What color would you like to use?",
> ["Blue", "Green"]);
> }
>
> auto num = require!(int, "a> 0&& a<= 10")("Enter a number from 1 to 10");
> }
>
> Opinions?
>
>
>
>
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
More information about the phobos
mailing list