std.getopt suggestion

2011-09-28 Thread Jonathan M Davis
Okay. I have a suggestion for an improvement to std.getopt that I think merits a bit of discussion. There's currently a pull request with some improvements for getopt which are mostly internal changes rather than API changes ( https://github.com/D-Programming-Language/phobos/pull/272 ), but I th

Re: std.getopt suggestion

2011-09-28 Thread Jacob Carlborg
On 2011-09-28 21:44, Jonathan M Davis wrote: Okay. I have a suggestion for an improvement to std.getopt that I think merits a bit of discussion. There's currently a pull request with some improvements for getopt which are mostly internal changes rather than API changes ( https://github.com/D-Prog

Re: std.getopt suggestion

2011-09-28 Thread Nick Sabalausky
"Jonathan M Davis" wrote in message news:mailman.260.1317239096.26225.digitalmar...@puremagic.com... > Okay. I have a suggestion for an improvement to std.getopt that I think > merits > a bit of discussion. There's currently a pull request with some > improvements > for getopt which are mostly

Re: std.getopt suggestion

2011-09-28 Thread Jonathan M Davis
On Wednesday, September 28, 2011 13:59 Nick Sabalausky wrote: > I like it. I wonder if having the GetOpt struct's defaults being different > from getopt() might be confusing. Other than that, I can't think of any > issues with any of it, unless there was some other aspect of the API we'd > want to

Re: std.getopt suggestion

2011-09-29 Thread Alex Rønne Petersen
On 28-09-2011 21:44, Jonathan M Davis wrote: Okay. I have a suggestion for an improvement to std.getopt that I think merits a bit of discussion. There's currently a pull request with some improvements for getopt which are mostly internal changes rather than API changes ( https://github.com/D-Prog

Re: std.getopt suggestion

2011-09-29 Thread Vladimir Panteleev
On Wed, 28 Sep 2011 22:44:29 +0300, Jonathan M Davis wrote: Personally, I think that it's a significant improvement given that it's getting rid of the mutable module-level variables and better encapsulating getopt's functionality, but I think that there's some value in discussing the idea

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/28/11 12:44 PM, Jonathan M Davis wrote: Okay. I have a suggestion for an improvement to std.getopt that I think merits a bit of discussion. There's currently a pull request with some improvements for getopt which are mostly internal changes rather than API changes ( https://github.com/D-Prog

Re: std.getopt suggestion

2011-09-29 Thread Rory McGuire
+1 On Wed, Sep 28, 2011 at 9:44 PM, Jonathan M Davis wrote: > Okay. I have a suggestion for an improvement to std.getopt that I think > merits > a bit of discussion. There's currently a pull request with some > improvements > for getopt which are mostly internal changes rather than API changes (

Re: std.getopt suggestion

2011-09-29 Thread Christophe
Andrei Alexandrescu , dans le message (digitalmars.D:145699), a écrit : >> and the aforementioned pull request adds another for an array separator. >> Mutable module/global variables are generally considered to be bad design >> (though they're sometimes necessary), and I'm very much inclined to hav

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 2:11 AM, Christophe wrote: Andrei Alexandrescu , dans le message (digitalmars.D:145699), a écrit : and the aforementioned pull request adds another for an array separator. Mutable module/global variables are generally considered to be bad design (though they're sometimes necessary), a

Re: std.getopt suggestion

2011-09-29 Thread Jonathan M Davis
On Thursday, September 29, 2011 00:40:44 Andrei Alexandrescu wrote: > On 9/28/11 12:44 PM, Jonathan M Davis wrote: > > Okay. I have a suggestion for an improvement to std.getopt that I think > > merits a bit of discussion. There's currently a pull request with some > > improvements for getopt which

Re: std.getopt suggestion

2011-09-29 Thread Nick Sabalausky
"Jonathan M Davis" wrote in message news:mailman.290.1317291489.26225.digitalmar...@puremagic.com... > > 5. Assuming that we were creating std.getopt from scratch, there would be > _zero_ benefit in having any of its configuration options be at the module > level. There is a definite argument for

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 3:17 AM, Jonathan M Davis wrote: On Thursday, September 29, 2011 00:40:44 Andrei Alexandrescu wrote: Why? 1. Mutable globals are generally considered to be bad practice. As you yourself have stated before, Phobos should be an example of good software practices in D. Having mutable g

Re: std.getopt suggestion

2011-09-29 Thread Vladimir Panteleev
On Thu, 29 Sep 2011 18:41:33 +0300, Andrei Alexandrescu wrote: It would be quite abnormal to run getopt multiple times in the same app with different configurations. So in this case using globals is _better_, not worse. How about this: your program uses a logging component. You pass the

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 8:49 AM, Vladimir Panteleev wrote: On Thu, 29 Sep 2011 18:41:33 +0300, Andrei Alexandrescu wrote: It would be quite abnormal to run getopt multiple times in the same app with different configurations. So in this case using globals is _better_, not worse. How about this: your progr

Re: std.getopt suggestion

2011-09-29 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:j623kg$rfi$1...@digitalmars.com... > > The proposed change adds net negative value. It forces people to create an > object in order to call a simple function > Not really: OptGetter.optGet(...); Even that "OptGetter." can be eliminated (parhaps afte

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 9:25 AM, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:j623kg$rfi$1...@digitalmars.com... The proposed change adds net negative value. It forces people to create an object in order to call a simple function Not really: OptGetter.optGet(...); Even that "OptG

Re: std.getopt suggestion

2011-09-29 Thread Christophe
Andrei Alexandrescu , dans le message (digitalmars.D:145742), a écrit : >> 4. If you need to run getopt multiple times - particularly if you need to run >> it with different configurations each time - it's definitely cleaner to do >> that >> when you can just use a different GetOpt instance in eac

Re: std.getopt suggestion

2011-09-29 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:j626io$10pu$1...@digitalmars.com... > On 9/29/11 9:25 AM, Nick Sabalausky wrote: >> "Andrei Alexandrescu" wrote in message >> news:j623kg$rfi$1...@digitalmars.com... >>> >>> The proposed change adds net negative value. It forces people to create >>> a

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 9:55 AM, Nick Sabalausky wrote: And the rest of us feel the same way about our arguments. Argumentum ad populum :o). Andrei

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 9:53 AM, Christophe wrote: Andrei Alexandrescu , dans le message (digitalmars.D:145742), a écrit : 4. If you need to run getopt multiple times - particularly if you need to run it with different configurations each time - it's definitely cleaner to do that when you can just use a diff

Re: std.getopt suggestion

2011-09-29 Thread David Nadlinger
On 9/29/11 6:57 PM, Andrei Alexandrescu wrote: On 9/29/11 9:55 AM, Nick Sabalausky wrote: And the rest of us feel the same way about our arguments. Argumentum ad populum :o). Errm … no? Argumentum ad populum would e.g. be »and the rest of us believe that your arguments are inferior, Andrei,

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 10:15 AM, David Nadlinger wrote: On 9/29/11 6:57 PM, Andrei Alexandrescu wrote: On 9/29/11 9:55 AM, Nick Sabalausky wrote: And the rest of us feel the same way about our arguments. Argumentum ad populum :o). Errm … no? Argumentum ad populum would e.g. be »and the rest of us belie

Re: std.getopt suggestion

2011-09-29 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:j629g0$15tr$2...@digitalmars.com... > On 9/29/11 10:15 AM, David Nadlinger wrote: >> On 9/29/11 6:57 PM, Andrei Alexandrescu wrote: >>> On 9/29/11 9:55 AM, Nick Sabalausky wrote: And the rest of us feel the same way about our arguments. >>> >>> Arg

Re: std.getopt suggestion

2011-09-29 Thread Jonathan M Davis
On Thursday, September 29, 2011 08:41 Andrei Alexandrescu wrote: > The proposed change adds net negative value. It forces people to create > an object in order to call a simple function, for the vague benefit of > tenuous corner cases. I specifically suggested that there still be a free getopt fun

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 11:07 AM, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:j629g0$15tr$2...@digitalmars.com... On 9/29/11 10:15 AM, David Nadlinger wrote: On 9/29/11 6:57 PM, Andrei Alexandrescu wrote: On 9/29/11 9:55 AM, Nick Sabalausky wrote: And the rest of us feel the same w

Re: std.getopt suggestion

2011-09-29 Thread Vladimir Panteleev
On Thu, 29 Sep 2011 18:55:39 +0300, Andrei Alexandrescu wrote: Sloppy maintainers may also take the GetOpt object by reference, change its state, and pass it back. See my suggestion earlier in this thread. -- Best regards, Vladimirmailto:vladi...@thecybershado

Re: std.getopt suggestion

2011-09-29 Thread Dmitry Olshansky
On 29.09.2011 21:01, Andrei Alexandrescu wrote: On 9/29/11 9:53 AM, Christophe wrote: Andrei Alexandrescu , dans le message (digitalmars.D:145742), a écrit : 4. If you need to run getopt multiple times - particularly if you need to run it with different configurations each time - it's definitel

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 11:18 AM, Jonathan M Davis wrote: On Thursday, September 29, 2011 08:41 Andrei Alexandrescu wrote: The proposed change adds net negative value. It forces people to create an object in order to call a simple function, for the vague benefit of tenuous corner cases. I specifically sugg

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 11:24 AM, Vladimir Panteleev wrote: On Thu, 29 Sep 2011 18:55:39 +0300, Andrei Alexandrescu wrote: Sloppy maintainers may also take the GetOpt object by reference, change its state, and pass it back. See my suggestion earlier in this thread. You mean this: > Another idea: > > G

Re: std.getopt suggestion

2011-09-29 Thread Jonathan M Davis
On Thursday, September 29, 2011 11:39 Andrei Alexandrescu wrote: > I don't think it would improve the module design, even without > considering cost of change. It just adds useless clutter. Well, out of those who have responded in this thread, you're the only one who thinks that. Everyone else ha

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 11:54 AM, Jonathan M Davis wrote: On Thursday, September 29, 2011 11:39 Andrei Alexandrescu wrote: I don't think it would improve the module design, even without considering cost of change. It just adds useless clutter. Well, out of those who have responded in this thread, you're th

Re: std.getopt suggestion

2011-09-29 Thread foobar
Andrei Alexandrescu Wrote: > On 9/29/11 11:18 AM, Jonathan M Davis wrote: > > On Thursday, September 29, 2011 08:41 Andrei Alexandrescu wrote: > >> The proposed change adds net negative value. It forces people to create > >> an object in order to call a simple function, for the vague benefit of >

Re: std.getopt suggestion

2011-09-29 Thread Jonathan M Davis
On Thursday, September 29, 2011 13:40 Andrei Alexandrescu wrote: > On 9/29/11 11:54 AM, Jonathan M Davis wrote: > > On Thursday, September 29, 2011 11:39 Andrei Alexandrescu wrote: > >> I don't think it would improve the module design, even without > >> considering cost of change. It just adds usel

Re: std.getopt suggestion

2011-09-29 Thread Jacob Carlborg
On 2011-09-29 22:40, Andrei Alexandrescu wrote: On 9/29/11 11:54 AM, Jonathan M Davis wrote: On Thursday, September 29, 2011 11:39 Andrei Alexandrescu wrote: I don't think it would improve the module design, even without considering cost of change. It just adds useless clutter. Well, out of t

Re: std.getopt suggestion

2011-09-29 Thread Andrei Alexandrescu
On 9/29/11 11:35 PM, Jacob Carlborg wrote: On 2011-09-29 22:40, Andrei Alexandrescu wrote: On 9/29/11 11:54 AM, Jonathan M Davis wrote: On Thursday, September 29, 2011 11:39 Andrei Alexandrescu wrote: I don't think it would improve the module design, even without considering cost of change. It

Re: std.getopt suggestion

2011-09-30 Thread Christophe
"Jonathan M Davis" , dans le message (digitalmars.D:145800), a écrit : > Honestly, I would vote against any code being included in Phobos which had any > mutable global variables without a _very_ good reason. And I really don't see > any such reason here. Look closely at the new benchmark proposal

Re: std.getopt suggestion

2011-09-30 Thread Christophe
foobar , dans le message (digitalmars.D:145799), a écrit : > Does getopt (btw, awful name) getopt is the name of a Posix function to read option arguments in many langages. I don't think it should be changed. People trying to accomplish this task will be looking for a function with that name. -

Re: std.getopt suggestion

2011-09-30 Thread Jacob Carlborg
On 2011-09-30 08:51, Andrei Alexandrescu wrote: On 9/29/11 11:35 PM, Jacob Carlborg wrote: On 2011-09-29 22:40, Andrei Alexandrescu wrote: On 9/29/11 11:54 AM, Jonathan M Davis wrote: On Thursday, September 29, 2011 11:39 Andrei Alexandrescu wrote: I don't think it would improve the module de

Re: std.getopt suggestion

2011-09-30 Thread Jonathan M Davis
On Friday, September 30, 2011 13:07:55 Christophe wrote: > foobar , dans le message (digitalmars.D:145799), a écrit : > > Does getopt (btw, awful name) > > getopt is the name of a Posix function to read option arguments in many > langages. I don't think it should be changed. People trying to > acc

Re: std.getopt suggestion

2011-09-30 Thread Andrei Alexandrescu
On 9/30/11 9:01 AM, Jonathan M Davis wrote: On Friday, September 30, 2011 13:07:55 Christophe wrote: foobar , dans le message (digitalmars.D:145799), a écrit : Does getopt (btw, awful name) getopt is the name of a Posix function to read option arguments in many langages. I don't think it shou

Re: std.getopt suggestion

2011-09-30 Thread Jonathan M Davis
On Friday, September 30, 2011 09:37 Andrei Alexandrescu wrote: > On 9/30/11 9:01 AM, Jonathan M Davis wrote: > > On Friday, September 30, 2011 13:07:55 Christophe wrote: > >> foobar , dans le message (digitalmars.D:145799), a écrit : > >>> Does getopt (btw, awful name) > >> > >> getopt is the name

Re: std.getopt suggestion

2011-09-30 Thread Christophe
"Jonathan M Davis" , dans le message (digitalmars.D:145845), a écrit : >> >> ahem > > ??? Please elaborate. Let me guess: He considers their is not enough improvement to justify a breaking change. It's quite obvious, since he considers this is a negative improvement.

Re: std.getopt suggestion

2011-09-30 Thread Jose Armando Garcia
On Wed, Sep 28, 2011 at 12:44 PM, Jonathan M Davis wrote: > So, my suggestion is that we create a GetOpt struct which contains all of the > options for getopt, and we make getopt a member function of that struct. Making it a struct gives you a design flexibility that really is an illusion. Most p

Re: std.getopt suggestion

2011-09-30 Thread Jonathan M Davis
On Friday, September 30, 2011 10:30 Christophe wrote: > "Jonathan M Davis" , dans le message (digitalmars.D:145845), a écrit : > >> ahem > > > > ??? Please elaborate. > > Let me guess: He considers their is not enough improvement to justify a > breaking change. It's quite obvious, since he consid

Re: std.getopt suggestion

2011-09-30 Thread Andrei Alexandrescu
On 9/30/11 10:55 AM, Jonathan M Davis wrote: On Friday, September 30, 2011 10:30 Christophe wrote: "Jonathan M Davis" , dans le message (digitalmars.D:145845), a écrit : ahem ??? Please elaborate. Let me guess: He considers their is not enough improvement to justify a breaking change. It's

Re: std.getopt suggestion

2011-09-30 Thread Nick Sabalausky
"Jose Armando Garcia" wrote in message news:mailman.317.1317404375.26225.digitalmar...@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

Re: std.getopt suggestion

2011-09-30 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:j651l8$7m7$1...@digitalmars.com... > "Jose Armando Garcia" wrote in message > news:mailman.317.1317404375.26225.digitalmar...@puremagic.com... >> >> I prefer if we take std.getopt one step further (or create another) >> and make it completely global. Don'

Re: std.getopt suggestion

2011-09-30 Thread Jacob Carlborg
On 2011-09-30 19:39, Jose Armando Garcia wrote: On Wed, Sep 28, 2011 at 12:44 PM, Jonathan M Davis wrote: So, my suggestion is that we create a GetOpt struct which contains all of the options for getopt, and we make getopt a member function of that struct. Making it a struct gives you a desig

Re: std.getopt suggestion

2011-09-30 Thread Andrei Alexandrescu
On 9/30/11 12:23 PM, Jacob Carlborg wrote: On 2011-09-30 19:39, Jose Armando Garcia wrote: On Wed, Sep 28, 2011 at 12:44 PM, Jonathan M Davis wrote: So, my suggestion is that we create a GetOpt struct which contains all of the options for getopt, and we make getopt a member function of that str

Re: std.getopt suggestion

2011-09-30 Thread Jose Armando Garcia
On Fri, Sep 30, 2011 at 11:27 AM, Nick Sabalausky wrote: > "Jose Armando Garcia" wrote in message > 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 othe

Re: std.getopt suggestion

2011-09-30 Thread Marco Leise
Am 30.09.2011, 20:28 Uhr, schrieb Nick Sabalausky : "Nick Sabalausky" wrote in message news:j651l8$7m7$1...@digitalmars.com... "Jose Armando Garcia" wrote in message news:mailman.317.1317404375.26225.digitalmar...@puremagic.com... I prefer if we take std.getopt one step further (or create a

Re: std.getopt suggestion

2011-10-01 Thread Jacob Carlborg
On 2011-10-01 00:17, Andrei Alexandrescu wrote: On 9/30/11 12:23 PM, Jacob Carlborg wrote: On 2011-09-30 19:39, Jose Armando Garcia wrote: On Wed, Sep 28, 2011 at 12:44 PM, Jonathan M Davis wrote: So, my suggestion is that we create a GetOpt struct which contains all of the options for getopt,

Re: std.getopt suggestion

2011-10-01 Thread Nick Sabalausky
"Marco Leise" wrote in message news:op.v2no2ljx9y6...@dslb-088-070-130-181.pools.arcor-ip.net... >Am 30.09.2011, 20:28 Uhr, schrieb Nick Sabalausky : >> >> It's like applying fascism to API design. > >You know, this will eventually end up where all discussions on the >internet end. ;) > Saskatc

Re: std.getopt suggestion

2011-10-01 Thread Nick Sabalausky
"Jose Armando Garcia" wrote in message news:mailman.321.1317434277.26225.digitalmar...@puremagic.com... > On Fri, Sep 30, 2011 at 11:27 AM, Nick Sabalausky wrote: >> "Jose Armando Garcia" wrote in message >> Are you serious? Don't allow it? Why? What benefit could that possibly >> provide? It m

Re: std.getopt suggestion

2011-10-01 Thread Andrei Alexandrescu
On 10/1/11 5:42 AM, Jacob Carlborg wrote: On 2011-10-01 00:17, Andrei Alexandrescu wrote: On 9/30/11 12:23 PM, Jacob Carlborg wrote: On 2011-09-30 19:39, Jose Armando Garcia wrote: On Wed, Sep 28, 2011 at 12:44 PM, Jonathan M Davis wrote: So, my suggestion is that we create a GetOpt struct wh

Re: std.getopt suggestion

2011-10-01 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:j679o0$1hdm$1...@digitalmars.com... > On 10/1/11 5:42 AM, Jacob Carlborg wrote: >> >> I forgot to mention that I don't want the order of the arguments to >> matter. I should be possible to write: >> >> "foo bar -b -a" >> >> Or at least it should be poss

Re: std.getopt suggestion

2011-10-01 Thread Andrei Alexandrescu
On 10/1/11 12:56 PM, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:j679o0$1hdm$1...@digitalmars.com... On 10/1/11 5:42 AM, Jacob Carlborg wrote: I forgot to mention that I don't want the order of the arguments to matter. I should be possible to write: "foo bar -b -a" Or

Re: std.getopt suggestion

2011-10-01 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:j67s2l$9h2$1...@digitalmars.com... > On 10/1/11 12:56 PM, Nick Sabalausky wrote: >> "Andrei Alexandrescu" wrote in message >> news:j679o0$1hdm$1...@digitalmars.com... >>> On 10/1/11 5:42 AM, Jacob Carlborg wrote: I forgot to mention that I do

Re: std.getopt suggestion

2011-10-01 Thread Andrei Alexandrescu
On 10/1/11 4:17 PM, Nick Sabalausky wrote: [snip] Not buying it. Sorry. Andrei

Re: std.getopt suggestion

2011-10-01 Thread David Nadlinger
On 10/2/11 1:01 AM, Andrei Alexandrescu wrote: On 10/1/11 4:17 PM, Nick Sabalausky wrote: [snip] Not buying it. Sorry. Andrei Sorry Andrei, not buying your opinion either. David And how exactly did this get us any further? :P

Re: std.getopt suggestion

2011-10-01 Thread Jonathan M Davis
On Sunday, October 02, 2011 01:35:09 David Nadlinger wrote: > On 10/2/11 1:01 AM, Andrei Alexandrescu wrote: > > On 10/1/11 4:17 PM, Nick Sabalausky wrote: > > [snip] > > > > Not buying it. Sorry. > > > > Andrei > > Sorry Andrei, not buying your opinion either. > > David > > > > And how exac

Re: std.getopt suggestion

2011-10-02 Thread Jacob Carlborg
On 2011-10-02 02:31, Jonathan M Davis wrote: On Sunday, October 02, 2011 01:35:09 David Nadlinger wrote: On 10/2/11 1:01 AM, Andrei Alexandrescu wrote: On 10/1/11 4:17 PM, Nick Sabalausky wrote: [snip] Not buying it. Sorry. Andrei Sorry Andrei, not buying your opinion either. David And

Re: std.getopt suggestion

2011-10-03 Thread Jonathan M Davis
On Monday, October 03, 2011 08:43:37 Jacob Carlborg wrote: > How about starting to review modules that existed before we started with > the review process. But I guess many will complain that the time can be > better spent elsewhere. I think that for the most part where there's really an issue wi

Re: std.getopt suggestion

2011-10-03 Thread Walter Bright
On 9/29/2011 11:54 AM, Jonathan M Davis wrote: And yes, that's an argument by ad populum (or whatever the exact name is), but what's considered "clutter" is subjective. Yes, the improvement would be relatively minor, but so's the cost of the change, and while it doesn't necessarily show that you'

Re: std.getopt suggestion

2011-10-03 Thread Jonathan M Davis
On Monday, October 03, 2011 21:20:48 Walter Bright wrote: > On 9/29/2011 11:54 AM, Jonathan M Davis wrote: > > And yes, that's an argument by ad populum > > (or whatever the exact name is), but what's considered "clutter" is > > subjective. Yes, the improvement would be relatively minor, but so's t

Re: std.getopt suggestion

2011-10-03 Thread Nick Sabalausky
"Walter Bright" wrote in message news:j6e1k9$2p9u$1...@digitalmars.com... > > Steve Jobs is famously successful for paring down feature sets to the bare > minimum that works for 90% of the users, and then doing those features > very well. > Steve Jobs is famous for handling the bare minimum th

Re: std.getopt suggestion

2011-10-03 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:j6e836$2gj$1...@digitalmars.com... > "Walter Bright" wrote in message > news:j6e1k9$2p9u$1...@digitalmars.com... >> >> Steve Jobs is famously successful for paring down feature sets to the >> bare minimum that works for 90% of the users, and then doing t

Re: std.getopt suggestion

2011-10-04 Thread Nick Sabalausky
"Walter Bright" wrote in message news:j6e1k9$2p9u$1...@digitalmars.com... > > 2. Once a feature is there, it stays forever. It's very hard to judge how > many people rely on a feature that turns out in hindsight to be baggage. If people are relying on it, is it really baggage? > It's why I hav

Re: std.getopt suggestion

2011-10-04 Thread Walter Bright
On 10/3/2011 11:11 PM, Nick Sabalausky wrote: Steve Jobs is famous for handling the bare minimum that works for 90% of *average Joe* users and saying "Fuck off" to everyone and everything else. That's why all his products are shit. On the other hand, D makes no attempt at a "walled garden". Nob

Re: std.getopt suggestion

2011-10-04 Thread Walter Bright
On 10/4/2011 1:06 AM, Nick Sabalausky wrote: "Walter Bright" wrote in message news:j6e1k9$2p9u$1...@digitalmars.com... 2. Once a feature is there, it stays forever. It's very hard to judge how many people rely on a feature that turns out in hindsight to be baggage. If people are relying on i

Re: std.getopt suggestion

2011-10-04 Thread Jacob Carlborg
On 2011-10-04 11:02, Walter Bright wrote: On 10/4/2011 1:06 AM, Nick Sabalausky wrote: "Walter Bright" wrote in message news:j6e1k9$2p9u$1...@digitalmars.com... 2. Once a feature is there, it stays forever. It's very hard to judge how many people rely on a feature that turns out in hindsight t

Re: std.getopt suggestion

2011-10-04 Thread Regan Heath
On Tue, 04 Oct 2011 05:20:48 +0100, Walter Bright wrote: I've been only a casual user of std.getopt, barely scratching the surface of what it can do. But I do have a few general thoughts on this. One of the very hardest things in design is knowing when to say "no" to a new feature. The fea

Re: std.getopt suggestion

2011-10-04 Thread Jacob Carlborg
On 2011-10-04 13:21, Regan Heath wrote: On Tue, 04 Oct 2011 05:20:48 +0100, Walter Bright wrote: I've been only a casual user of std.getopt, barely scratching the surface of what it can do. But I do have a few general thoughts on this. One of the very hardest things in design is knowing when t

Re: std.getopt suggestion

2011-10-04 Thread Andrei Alexandrescu
On 10/04/11 09:09, Jacob Carlborg wrote: On 2011-10-04 13:21, Regan Heath wrote: In this particular case, because these std,.getopt options are global variables, building something which uses them, or std.getopt will introduce side effects to other uses of std.getopt. Meaning the current design

Re: std.getopt suggestion

2011-10-04 Thread Andrej Mitrovic
I'm don't often use getopt just for the fact that I can't use single-dash arguments like '-release'. DMD uses this syntax, and so to other tools. It's not a big deal thanks to D's fantastic string-manipulation abilities, so I just roll my own. All I need is a switch(args) statement.

Re: std.getopt suggestion

2011-10-04 Thread Jacob Carlborg
On 2011-10-04 17:48, Andrei Alexandrescu wrote: On 10/04/11 09:09, Jacob Carlborg wrote: On 2011-10-04 13:21, Regan Heath wrote: In this particular case, because these std,.getopt options are global variables, building something which uses them, or std.getopt will introduce side effects to othe

Re: std.getopt suggestion

2011-10-04 Thread Walter Bright
On 10/4/2011 2:55 AM, Jacob Carlborg wrote: They at least removed export templates. True. I know there were some adamant defenders of it in the past, but I don't know if anyone defended it this time. A difference from trigraphs is that export was implemented by only one vendor, and every othe

Re: std.getopt suggestion

2011-10-04 Thread Christophe
Andrej Mitrovic , dans le message (digitalmars.D:146060), a écrit : > I'm don't often use getopt just for the fact that I can't use > single-dash arguments like '-release'. DMD uses this syntax, and so to > other tools. It's not a big deal thanks to D's fantastic > string-manipulation abilities, so

Re: std.getopt suggestion

2011-10-04 Thread Andrei Alexandrescu
On 10/4/11 12:46 PM, Jacob Carlborg wrote: On 2011-10-04 17:48, Andrei Alexandrescu wrote: On 10/04/11 09:09, Jacob Carlborg wrote: On 2011-10-04 13:21, Regan Heath wrote: In this particular case, because these std,.getopt options are global variables, building something which uses them, or st

Re: std.getopt suggestion

2011-10-04 Thread Andrei Alexandrescu
On 10/4/11 2:39 PM, Andrei Alexandrescu wrote: On 10/4/11 12:05 PM, Christophe wrote: Andrej Mitrovic , dans le message (digitalmars.D:146060), a écrit : I'm don't often use getopt just for the fact that I can't use single-dash arguments like '-release'. DMD uses this syntax, and so to other to

Re: std.getopt suggestion

2011-10-04 Thread Andrei Alexandrescu
On 10/4/11 12:05 PM, Christophe wrote: Andrej Mitrovic , dans le message (digitalmars.D:146060), a écrit : I'm don't often use getopt just for the fact that I can't use single-dash arguments like '-release'. DMD uses this syntax, and so to other tools. It's not a big deal thanks to D's fantastic

Re: std.getopt suggestion

2011-10-04 Thread Christophe
Andrei Alexandrescu , dans le message (digitalmars.D:146070), a écrit : > On 10/4/11 2:39 PM, Andrei Alexandrescu wrote: >> On 10/4/11 12:05 PM, Christophe wrote: >>> Andrej Mitrovic , dans le message (digitalmars.D:146060), a écrit : I'm don't often use getopt just for the fact that I can't u

Re: std.getopt suggestion

2011-10-04 Thread Andrei Alexandrescu
On 10/4/11 3:10 PM, Christophe wrote: Andrei Alexandrescu , dans le message (digitalmars.D:146070), a écrit : On 10/4/11 2:39 PM, Andrei Alexandrescu wrote: On 10/4/11 12:05 PM, Christophe wrote: Andrej Mitrovic , dans le message (digitalmars.D:146060), a écrit : I'm don't often use getopt ju

Re: std.getopt suggestion

2011-10-04 Thread Marco Leise
Am 04.10.2011, 22:41 Uhr, schrieb Andrei Alexandrescu : does -in mean --in or -i -n? This case must be prohibited and exorcised. You should decide to either use bundling of -i -n to -in *or* use single dash long arguments. DMD does *not* allow -wv for example although both letters are va

Re: std.getopt suggestion

2011-10-04 Thread Andrej Mitrovic
Yeah I've never seen --abc used as -a -b -c before, it looks quite strange to me. Is this common in unixland?

Re: std.getopt suggestion

2011-10-04 Thread Jonathan M Davis
On Wednesday, October 05, 2011 02:51:47 Andrej Mitrovic wrote: > Yeah I've never seen --abc used as -a -b -c before, it looks quite > strange to me. Is this common in unixland? In unix land, the normal situation is that -- denotes a flag with one or more characters in it, whereas - denotes a flag

Re: std.getopt suggestion

2011-10-04 Thread Andrei Alexandrescu
On 10/4/11 7:51 PM, Andrej Mitrovic wrote: Yeah I've never seen --abc used as -a -b -c before, it looks quite strange to me. Is this common in unixland? No, but bundling -abc as -a -b -c is quite common, particularly in older programs. Andrei

Re: std.getopt suggestion

2011-10-04 Thread Jonathan M Davis
On Tuesday, October 04, 2011 20:28:30 Andrei Alexandrescu wrote: > On 10/4/11 7:51 PM, Andrej Mitrovic wrote: > > Yeah I've never seen --abc used as -a -b -c before, it looks quite > > strange to me. Is this common in unixland? > > No, but bundling -abc as -a -b -c is quite common, particularly in

Re: std.getopt suggestion

2011-10-04 Thread Marco Leise
Am 05.10.2011, 03:28 Uhr, schrieb Jonathan M Davis : On Wednesday, October 05, 2011 02:51:47 Andrej Mitrovic wrote: Yeah I've never seen --abc used as -a -b -c before, it looks quite strange to me. Is this common in unixland? In unix land, the normal situation is that -- denotes a flag with o

Re: std.getopt suggestion

2011-10-04 Thread Jacob Carlborg
On 2011-10-04 21:39, Andrei Alexandrescu wrote: On 10/4/11 12:46 PM, Jacob Carlborg wrote: On 2011-10-04 17:48, Andrei Alexandrescu wrote: On 10/04/11 09:09, Jacob Carlborg wrote: On 2011-10-04 13:21, Regan Heath wrote: In this particular case, because these std,.getopt options are global var

Re: std.getopt suggestion

2011-10-05 Thread Regan Heath
On Tue, 04 Oct 2011 20:39:42 +0100, Andrei Alexandrescu wrote: On 10/4/11 12:46 PM, Jacob Carlborg wrote: On 2011-10-04 17:48, Andrei Alexandrescu wrote: On 10/04/11 09:09, Jacob Carlborg wrote: On 2011-10-04 13:21, Regan Heath wrote: In this particular case, because these std,.getopt opt

Re: std.getopt suggestion

2011-10-05 Thread Steven Schveighoffer
On Wed, 05 Oct 2011 07:53:25 -0400, Regan Heath wrote: On Tue, 04 Oct 2011 20:39:42 +0100, Andrei Alexandrescu wrote: On 10/4/11 12:46 PM, Jacob Carlborg wrote: On 2011-10-04 17:48, Andrei Alexandrescu wrote: On 10/04/11 09:09, Jacob Carlborg wrote: On 2011-10-04 13:21, Regan Heath wr

Re: std.getopt suggestion

2011-10-05 Thread Jens Mueller
Christophe wrote: > Andrei Alexandrescu , dans le message (digitalmars.D:146070), a écrit : > > On 10/4/11 2:39 PM, Andrei Alexandrescu wrote: > >> On 10/4/11 12:05 PM, Christophe wrote: > >>> Andrej Mitrovic , dans le message (digitalmars.D:146060), a écrit : > I'm don't often use getopt just

Re: std.getopt suggestion

2011-10-05 Thread Christophe
Jens Mueller , dans le message (digitalmars.D:146111), a écrit : > Christophe wrote: >> Andrei Alexandrescu , dans le message (digitalmars.D:146070), a écrit : >> > On 10/4/11 2:39 PM, Andrei Alexandrescu wrote: >> >> On 10/4/11 12:05 PM, Christophe wrote: >> >>> Andrej Mitrovic , dans le message (

Re: std.getopt suggestion

2011-10-05 Thread Jens Mueller
Christophe wrote: > Jens Mueller , dans le message (digitalmars.D:146111), a écrit : > > Christophe wrote: > >> Andrei Alexandrescu , dans le message (digitalmars.D:146070), a écrit : > >> > On 10/4/11 2:39 PM, Andrei Alexandrescu wrote: > >> >> On 10/4/11 12:05 PM, Christophe wrote: > >> >>> Andre

Re: std.getopt suggestion

2011-10-05 Thread Andrei Alexandrescu
On 10/5/11 6:53 AM, Regan Heath wrote: On Tue, 04 Oct 2011 20:39:42 +0100, Andrei Alexandrescu wrote: Did it ever prevent you from getting anything done with it? That's not the question we should be asking. The question we should be asking is, will anyone ever want to re-use getopts parser fo

Re: std.getopt suggestion

2011-10-05 Thread Jonathan M Davis
On Wednesday, October 05, 2011 16:24:32 Jens Mueller wrote: > > However, the current way to parametrise getopt is to change the > > character for options ('-'), and I belive the string for long option is > > twice the character for short option ("--"). I don't think this makes > > great sense. We c

Re: std.getopt suggestion

2011-10-05 Thread Christophe
Jens Mueller , dans le message (digitalmars.D:146114), a écrit : > Christophe wrote: >> Jens Mueller , dans le message (digitalmars.D:146111), a écrit : >> > Christophe wrote: >> >> Andrei Alexandrescu , dans le message (digitalmars.D:146070), a écrit : >> >> > On 10/4/11 2:39 PM, Andrei Alexandres

Re: std.getopt suggestion

2011-10-05 Thread Christophe
At last you say something I can agree with in this thread.

  1   2   >