octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using exceptions in the core


From: Rik
Subject: Re: Using exceptions in the core
Date: Tue, 6 Oct 2015 13:14:24 -0700

On 10/06/2015 12:49 PM, address@hidden wrote:
Subject:
Re: Using exceptions in the core
From:
"John W. Eaton" <address@hidden>
Date:
10/06/2015 12:13 PM
To:
address@hidden
List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
7bit
Precedence:
list
MIME-Version:
1.0
References:
<address@hidden> <address@hidden> <address@hidden> <address@hidden>
In-Reply-To:
<address@hidden>
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=utf-8; format=flowed
Message:
6

On 10/02/2015 06:14 PM, John W. Eaton wrote:
On 10/02/2015 03:15 PM, John W. Eaton wrote:
On 10/02/2015 02:39 PM, Rik wrote:

I also like the overloaded _value() method idea.  We could start out
small by just overloading the string_value () method since this seems to
be one of the most frequent occurrences where the function expected a
string, for an option maybe, but numeric input was given.

Yes, I think this is the most frequent case of something like

   if (! args(0).is_string ())
     {
       error ("...");
       return retval;
     }

so I think it makes sense to start with this one and see what we think.
  I'll work on this with my other changes.

My current idea is attached.  With it, you can write something like

   std::string url = "" ("urlwrite: URL must be a
string");

Comments?

Any comments on this proposal?

I think the overloaded string_value method is much nicer than the longer explicit test for is_string.

That's my vote,
Rik

reply via email to

[Prev in Thread] Current Thread [Next in Thread]