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

Static Term property for duck typing? #105

Closed
blake-regalia opened this issue Mar 13, 2017 · 3 comments
Closed

Static Term property for duck typing? #105

blake-regalia opened this issue Mar 13, 2017 · 3 comments

Comments

@blake-regalia
Copy link
Contributor

Libraries can choose to have API functions that accept RDFJS Terms as well as some other types of objects. For these cases, it may be useful to define a static property on Term to distinguish Term objects from others.

While testing for a truthy .termType might seem sufficient, it is arguably not semantically robust enough. Perhaps defining a static boolean .isRDFJSTerm property on Term would enable universal duck typing?

@RubenVerborgh
Copy link
Member

It's definitely good to have this discussion: the spec should define a test whether something is a Term.

I think that we can manage with existing properties though, such as indeed termType. (If termType doesn't do the trick, than the odds are that .isRDFJSTerm also won't do.)

@elf-pavlik
Copy link
Member

@blake-regalia do you still see a need for something like .isRDFJSTerm you originally proposed?

This issue could relate to #137

@elf-pavlik
Copy link
Member

Let's close it due to lack of activity, please just reopen if needed.

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

3 participants