std.getopt suggestion

Nick Sabalausky a at a.a
Fri Sep 30 11:28:55 PDT 2011


"Nick Sabalausky" <a at a.a> wrote in message 
news:j651l8$7m7$1 at digitalmars.com...
> "Jose Armando Garcia" <jsancio at gmail.com> wrote in message 
> news:mailman.317.1317404375.26225.digitalmars-d at puremagic.com...
>>
>> I prefer if we take std.getopt one step further (or create another)
>> and make it completely global. Don't allow the parsing of anything but
>> the command line
>
> Are you serious? Don't allow it? Why? What benefit could that possibly 
> provide? It makes perfect sence to think that there may be legitimate 
> reason to use a commandline parser on something other than the current 
> process's cmd args. Unittesting, for one, just off the top of my head. 
> Other people here have mentioned other uses.
>
> It doesn't make any sence at all to arbitrarily prevent a tool from being 
> applied to whatever the user chooses to apply it to.
>

It's like applying fascism to API design.

>> and make the results of the parsing available as
>> immutable to all the threads in the process.
>
> So you want to prevent people from being able to enforce encapsulation of 
> that? If they want to make it available, they can trivially do that 
> theirself. But you can't go the other way around.
>
> 




More information about the Digitalmars-d mailing list