octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #65538] xint_value does not work the way it is


From: Rik
Subject: [Octave-bug-tracker] [bug #65538] xint_value does not work the way it is intended
Date: Fri, 29 Mar 2024 17:54:46 -0400 (EDT)

Follow-up Comment #1, bug #65538 (group octave):

Maybe this should be on Discourse, rather than the bug tracker, but one answer
would be to use int_value() with the first input set to true.  The prototype
for the function in ov.h is


  int int_value (bool req_int = false, bool frc_str_conv = false) const


The first input, require_integer, is defaulted to false.  This will emit an
error about not having an integer input, but the message is not customizable. 
For that, you would need to put the call to int_value() in a try/catch block.

xint_value() only emits an error when it can't convert the input to an
integer, not when the original value is not something that can be coerced to
integer.  For example,


all (1, {1})
error: all: DIM must be an integer




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65538>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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