Skip to content

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