We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
version
0.8.124
problem
I would like to extend protocols to JavaScript Objects, Arrays, etc.
However, I receive an extend_protocol is not defined error each time.
extend_protocol is not defined
First I define a protocol:
(defprotocol Identity (i [this]))
Then I try to extend it. I tried a few things:
(extend-protocol Identity object (i [s] s)) (extend-protocol Identity js/Object (i [s] s)) (extend-protocol Identity Object (i [s] s))
Similar experiments with array and string produced the same error.
repro
Repro in the squint playground
expected behavior
I'd expect something like this:
(defprotocol Identity (i [this])) (extend-protocol Identity object (i [s] s)) (i {:hello :world}) ; => {:hello :world}
The text was updated successfully, but these errors were encountered:
This is due to the absence of extend-protocol currently, but not that extend-type is available:
extend-protocol
extend-type
$ ./node_cli.js -e '(defprotocol Identity (i [this])) (extend-type object Identity (i [s] s)) (js/console.log (i 1))' 1
I'll add extend-protocol
Sorry, something went wrong.
b38f130
No branches or pull requests
version
0.8.124
problem
I would like to extend protocols to JavaScript Objects, Arrays, etc.
However, I receive an
extend_protocol is not defined
error each time.First I define a protocol:
Then I try to extend it. I tried a few things:
Similar experiments with array and string produced the same error.
repro
Repro in the squint playground
expected behavior
I'd expect something like this:
The text was updated successfully, but these errors were encountered: