[bug #68172] any() and all() should work only on numeric or logical args

Thomas <[email protected]>
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

Follow-up Comment #6, bug #68172 (group octave):

I've attached an updated patch that has extra tests for `all` and `any` in
data.cc. I've also removed the OCTINTERP_OVERRIDABLE_FUNC_API visibility
attribute on the `all` and `any` methods in the subclasses, since no other
overriding method in these subclasses contain these attributes. I still don't
really understand the full purpose of the attributes, though, and I'd
appreciate some clarification on this.

Here's the tests from comment #2 and comment #4, run with the attached patch:


>> b = struct("a", 1, "b", 2);
>> any(b)
error: octave_base_value::any (): wrong type argument 'scalar struct'
>> all(b)
error: octave_base_value::all (): wrong type argument 'scalar struct'
>> a = [b,b];
>> any(a)
error: octave_base_value::any (): wrong type argument 'struct'
>> all(a)
error: octave_base_value::all (): wrong type argument 'struct'
>> c = inputParser;
>> any(c);
error: octave_base_value::any (): wrong type argument 'object'
>> all(c);
error: octave_base_value::all (): wrong type argument 'object'
>> d = [c,c];
>> any(d)
error: octave_base_value::any (): wrong type argument 'object'
>> all(d)
error: octave_base_value::all (): wrong type argument 'object'
>> foo = {1,2;a,b};
>> any(foo)
error: octave_base_value::any (): wrong type argument 'cell'
>> all(foo)
error: octave_base_value::all (): wrong type argument 'cell'


(file #58401)

    _______________________________________________________

Additional Item Attachment:

Name: bug68172_v3.patch              Size: 16KiB
    <https://file.savannah.gnu.org/file/bug68172_v3.patch?file_id=58401>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-bca8bba9219e5e775909ef19815745fa29ed2236.tar.gz


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCacVHzwAKCRCqLAuaBUf3
ThE5AQDcjrQDUGiNmV5Ng29tnm8VYS2aMj9WoylTP1s6g4F0CAD9GA8DBiXp56OD
UcNvbzmEZhIaaGEtUSjgjIXgsbS75gE=
=zwzv
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.