joker

Discuss all things joker, the Clojure interpreter/linter on top of Go. https://github.com/candid82/joker
2018-05-11T19:51:43.000370Z

so core.match has a weird syntax for matching on function values that basically looks like

(matched-value :<< fn-to-apply)

2018-05-11T19:52:01.000283Z

which in practice looks like:

(true :<< empty?)

2018-05-11T19:52:11.000390Z

and unfortunately joker complains that true isn’t a function

2018-05-11T19:52:35.000560Z

as far as I can tell there doesn’t seem to be a way to tell joker to ignore that case

2018-05-11T19:53:19.000345Z

any body have any advice?

2018-05-11T19:53:36.000402Z

besides opening a pull request haha

Candid 2018-05-11T21:09:16.000439Z

I am assuming (true :<< empty?) is inside some sort of macro?

Candid 2018-05-11T21:09:40.000131Z

(sorry, not familiar with core.match)

2018-05-11T21:17:30.000379Z

yeah its within the core.match/match macro

2018-05-11T21:17:39.000450Z

which i added to the known macros list

2018-05-11T21:17:44.000109Z

and that fixed a few of the errors

2018-05-11T21:18:00.000226Z

but whatever the linter rule is for ‘true is not a function’ doesn’t care about the known macros list

Candid 2018-05-11T21:26:15.000396Z

right, macros are extremely problematic for linters. They only way to fix the issue would be to "teach" joker that core.match/match macro (or a simplified version of it), so that it expands the body into something that can be linted. There is a way to provide Joker with additional definitions (including macros). See this comment: https://github.com/candid82/joker/issues/52#issuecomment-385142109 It may or may not be practical for core.match/match as I suppose that macro is quite complex.

2018-05-11T21:43:10.000228Z

ok thanks i’ll look into that

2018-05-11T21:44:19.000172Z

seems like i could use that approach to just make it not lint the body of the match macro

2018-05-11T21:44:29.000154Z

which is a fine solution for me

Candid 2018-05-11T21:46:02.000396Z

yep, you can always expand to empty body, which will effectively remove the body before linting pass

2018-05-11T22:23:01.000322Z

ok yeah that works. it also means that i have to add some more ignored unused namespaces since they are used in the macro body but thats ok

2018-05-11T22:23:29.000243Z

if i had more time i’d use this as an excuse to learn some go

2018-05-11T22:23:33.000110Z

haha