You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure that I would recommend this -- if you really want this validation, another approach would be to wrap the function that's an argument in a schematized function.
That said, we do test equality like this in the tests (just to make sure fns get the right schemas):
you can see that the issue is the argument names are part of the fn-schema (and I don't think there's a way to provide them). They are in there to provide nice documentation of the arglists for tooling, IIRC. I guess technically FnSchema could ignore them when computing equality, but then it couldn't be a Record, and all in all I'm not sure it would be a net win.
That said, if you really want this, you could just write your own `equivalent-fn-schemas
That said, if you really want this, you could just write your own equivalent-fn-schemas function that ignores the arg names and use that in place of =.
Activity
w01fe commentedon Sep 30, 2016
I'm not sure that I would recommend this -- if you really want this validation, another approach would be to wrap the function that's an argument in a schematized function.
That said, we do test equality like this in the tests (just to make sure fns get the right schemas):
https://github.com/plumatic/schema/blob/master/test/cljx/schema/core_test.cljx#L855
The catch is, if you look inside the objects:
you can see that the issue is the argument names are part of the fn-schema (and I don't think there's a way to provide them). They are in there to provide nice documentation of the arglists for tooling, IIRC. I guess technically FnSchema could ignore them when computing equality, but then it couldn't be a Record, and all in all I'm not sure it would be a net win.
That said, if you really want this, you could just write your own `equivalent-fn-schemas
w01fe commentedon Sep 30, 2016
oops, submitted by accident.
That said, if you really want this, you could just write your own
equivalent-fn-schemasfunction that ignores the arg names and use that in place of=.Does that all make sense? HTH