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

Box of non-identity bearing object #1

Closed
mhofman opened this issue Sep 22, 2021 · 1 comment · Fixed by #2
Closed

Box of non-identity bearing object #1

mhofman opened this issue Sep 22, 2021 · 1 comment · Fixed by #2

Comments

@mhofman
Copy link

mhofman commented Sep 22, 2021

Allowing Box(42) is different from allowing Box(#{}) in the case where typeof #{} === 'object'.

Also I think the message makes strong assumptions:

If primitives can be stored in a Box, then code checking if a Record/Tuple transitively contains an object can no longer be performed with a containsBoxes predicate. Instead the code will need to also check the contents of the boxes.

We could imagine a different predicate, aka Box.hasBoxWithIdentity or Object.containsObject (with identity bearing object being implied). Similarly I would precise that the alternative would be to recursively check the content of boxes.

@acutmore
Copy link
Owner

Thanks for raising this @mhofman - the more issues that are raised to ensure the right details are captured in the right tone the more valuable I think this tool will be.

I've raised a PR that attempts to address this issue.

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 a pull request may close this issue.

2 participants