Skip to content

Make find's default predicate be identity #23120

Closed

Description

As discussed in #23005, the zeroness predicate is not uniquely defined. It seems odd to pick one for find. However, one really useful property of this is that it returns the true indices for boolean arrays, so you can do things like find(x .== 1), which we should preserve. I thus propose to make the default predicate be identity to retain the useful behavior for boolean arrays, but force the user to choose their predicate for numeric arrays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

collectionsData structures holding multiple items, e.g. sets

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions