The D Scripting Language

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Nov 10 14:34:31 PST 2010


On 11/10/10 1:45 PM, Tomek Sowiński wrote:
> Andrei Alexandrescu napisał:
>
>>> I'm having trouble thinking of something that would go in this module
>>> that wouldn't be a better fit somewhere else. What do you envision?
>>
>> I thought of it for a bit, but couldn't come up with anything :o). I
>> think you're right!
>
> Yeah, I think std.all would be just fine, or as Pelle proposed, a module publicly importing a first-aid kit for scripting.
>
>> Someone proposed to add something like
>> http://docs.python.org/library/fileinput.html to Phobos. I think it's a
>> good idea. We have all mechanics in place (byLine/byChunk, chain). So it
>> should be easy to define byLine to accept an array of filenames:
>>
>> import std.stdio;
>> void main(string args[]) {
>> getopt(args, ...);
>
> Speaking of getopt, when writing the 'grep' snippet I missed anonymous options a lot:
>
> bool h, i; string expr; string[] files;
> getopt(args, "h",&h, "i",&i,&expr,&files);
>
> They can be implemented with relatively little effort.

Not getting the example. How would anonymous options work?


Andrei



More information about the Digitalmars-d mailing list