Welcome to Web-News
A Web-based News Reader
Subject Re: Return value from getopt?
From Janice Caron <caron800@googlemail.com>
Date Wed, 23 Jan 2008 14:40:54 +0000
Newsgroups digitalmars.D

On Jan 23, 2008 2:26 PM, Jarrett Billingsley <kb3ctd2@yahoo.com> wrote:
> You don't have to guess.  The source code for Phobos is available for your
> perusal in every D compiler distribution.  And you're right, it just returns
> true for success and false for failure.

Good point. I hadn't thought of that. For some mad reason I keep
expecting the documentation to be enough! :-)


> > If the second case, please can the function signature be changed to
> > return void, and an exception thrown on error?
>
> It probably should..

In that case, I'd like to request of Walter that this be changed.
Otherwise, all of my code which uses getopt will have to do lots of
ugly error checking of the return code. Moreover, if it fails, there's
no obvious way to find out why it failed, wheras an exception could
carry that information.

Recent messages in this thread
 
-# Return value from getopt? Janice Caron 23-Jan-2008 03:44 am
.-# Re: Return value from getopt? Jarrett Billingsley 23-Jan-2008 09:26 am
..|# Re: Return value from getopt? (Current message) Janice Caron 23-Jan-2008 09:40 am
..\# Re: Return value from getopt? Brad Roberts 23-Jan-2008 01:09 pm