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

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

[Octave-bug-tracker] [bug #50854] zeros, ones, NaN, Inf, NA: "like" keyw


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #50854] zeros, ones, NaN, Inf, NA: "like" keyword
Date: Sun, 7 Jun 2020 14:54:11 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #22, bug #50854 (project octave):

I made the changes mentioned in comment #21 and transformed your diff into a
mercurial patch.

In the Matlab documentation for "cast", they mention that only input of one of
the built-in numeric classes is allowed.
>From our documentation it looks like we want to allow input of any
user-defined class, too.
In the light of that, I wonder if it is ok to impose the following condition
on the input "val":

  if (! isnumeric (val) && ! islogical (val) && ! ischar (val))
    error("cast: type conversion from '%s' is not supported ", class (val));
  endif


Maybe we should drop that input check completely. Instead we could let the
target class constructor allow to error out if the conversion is not
implemented (like e.g. from struct to double).

(file #49223)
    _______________________________________________________

Additional Item Attachment:

File name: bug50854_cast_like_v3.patch    Size:4 KB
    <https://savannah.gnu.org/file/bug50854_cast_like_v3.patch?file_id=49223>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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