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

Fix protocol? function #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mikesperber
Copy link

Some maps raise an exception on just calling the keyword. Use contains? instead.

@weavejester
Copy link
Owner

Can you give an example of a map that raises an exception upon calling the keyword?

Also can you change the Unbreak protocol? to Fix protocol? function.

@mikesperber mikesperber changed the title Unbreak protocol? Fix protocol? function Apr 16, 2024
@mikesperber
Copy link
Author

@weavejester Sorry, just seeing your reply now!

Can you give an example of a map that raises an exception upon calling the keyword?

The records from Active Data are maps like this, and running lein codox there bombs:

https://github.com/active-group/active-data

@weavejester
Copy link
Owner

So custom record types might be defined in vars, and these might self-identify as Clojure maps, but lack the same lookup properties. I guess there's no harm in changing a lookup to a contains? check to avoid tripping up in that situation. Can you update the commit description as per my previous comment? Then I'll merge and cut a release.

Some maps raise an exception on just calling the keyword.  Use
contains? instead.
@mikesperber
Copy link
Author

Can you update the commit description as per my previous comment? Then I'll merge and cut a release.

@weavejester Done. Many thanks!

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

Successfully merging this pull request may close these issues.

2 participants