[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.
URL:
<https://savannah.gnu.org/bugs/?68172>
Summary: any() and all() should work only on numeric or
logical args
Group: GNU Octave
Submitter: kolmanthomas
Submitted: Tue 24 Mar 2026 05:35:44 PM UTC
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Thomas Kolman
Originator Email:
Open/Closed: Open
Discussion Lock: Unlocked
Release: dev
Operating System: Any
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Tue 24 Mar 2026 05:35:44 PM UTC By: Thomas <kolmanthomas>
Current behaviour of `any` and `all` is to return 0 when used on a classdef
object.
For example: a classdef `foo` with no overloaded `any` or `all` methods that
is otherwise arbitrary, then
>> obj = foo();
>> all(obj)
ans = 0
>> any(obj)
ans = 0
Same with a struct.
There should be an error when `any` or `all` is used on a classdef object
which does not explicitly overload either one of these methods.
_______________________________________________________
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----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCacLLdQAKCRCqLAuaBUf3 TjrNAQCF8LkTR9ioplGRkLIuszhuzeJ7OEQ+lhh3h62FbMiJBQEA9aNLPRLUFQKz SY60xZRW2dVk6IAhT2ELTXI8MmMM3gc= =3SFP -----END PGP SIGNATURE-----