[phobos] readf for the novice

Jesse Phillips jesse.k.phillips at gmail.com
Tue Sep 14 19:15:19 PDT 2010


Thank you for the response and I can understand leaving it out of Phobos.
I'd like to claim that it is similar in manner to getopt, but there is
actually a standard for passing parameters to a program so...

On Tue, Sep 14, 2010 at 7:29 AM, Andrei Alexandrescu <andrei at erdani.com>wrote:

> 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
>>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>



-- 
Liberty means responsibility. That is why most men dread it.
  - George Bernard Shaw
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100914/6d1dbf09/attachment.html>


More information about the phobos mailing list