Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Given a collection C, should we support isC[Type|Value] queries? #16171

Open
bradcray opened this issue Jul 29, 2020 · 1 comment
Open

Given a collection C, should we support isC[Type|Value] queries? #16171

bradcray opened this issue Jul 29, 2020 · 1 comment

Comments

@bradcray
Copy link
Member

While working with lists today in a generic programming context, I found myself wanting queries like isListType(), isListValue(), isList() and ended up writing them myself. Should modules that introduce collection types like List.chpl support such queries by convention?

@vasslitvinov
Copy link
Member

Creating isList() makes sense.

However, the less-than comparison on types seems just as easy to use:

if (my expression).type <= list then ...

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

No branches or pull requests

2 participants