-
Notifications
You must be signed in to change notification settings - Fork 6
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
Minor placeholder cleanup. #31
Conversation
No need to use a symbol here--just use a unique object. Saves us a dependency and a file. This commit has no effect on user-visible functionality. Unit tests pass.
We discussed this in #25 and @tomekwi had a really good point on this #25 (comment) |
@stoeffel Not sure which comment you are referring to. If it is the one about Symbol being better than string, of course it is, but it's not necessary when you can just use Please try out the PR if you have time. It works perfectly in every regard, without using symbols. |
@rtm Will check it out, as soon as possible. |
If we were to get rid of the symbol polyfill we should at least keep the let curryPlaceholder = '@@currythis';
if(typeof Symbol === 'function' && typeof Symbol.for === 'function') {
curryPlaceholder = Symbol.for('currythis');
} |
@davidchase Why? This PR uses a unique empty object as a placeholder. This is fast and easy to compare for strict equality, and requires neither symbols nor strings. |
@rtm agreed. I would prefer an object over a string. I actually don't see a reason why we couldn't merge this. But I will have a night sleep over it and decide tomorrow. |
@davidchase Well, interop will work only if all libraries adopt the same convention, which seems unlikely. Anyway, thanks for referring to that thread. As far as I can tell, it seems to be discussing two different issues:
|
@davidchase I agree with @rtm for that matter. As well as that – when one module defines |
@stoeffel PR updated with new placeholder value |
Awesome thx! |
No need to use a symbol here--just use a unique object.
Saves us a dependency and a file.
This commit has no effect on user-visible functionality.
Unit tests pass.