-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement juxt #5
Conversation
Actually, how do I go about testing this E2E? |
There's currently no tests. If you feel like working on that, that could be very useful to this project. For a possible test setup you could look at: https://github.com/borkdude/flycheck-clj-kondo Instead of emitting an inline definition of |
Thanks, I'll check out clj-kondo. When you say top-level fn, do you mean implementing |
I mean, we can emit this first:
and then we just leave the call to |
Sorry, not sure I follow. Clarifying, did you mean to generate: (defun juxt (&rest fns)
(&rest xs)
(mapcar
(lambda (f) (apply f xs))
fns)) and reuse this fn for subsequent calls? |
exactly :) |
What's the best way to check if |
We can keep that as state in the global context. But feel free to skip this requirement and continue with the inline implementation, I can take care of that part :) |
If you're trying to install babashka in Github actions, I recommend using the https://github.com/DeLaGuardo/setup-clojure action. It's much faster than brew. |
Similarly for Windows: there is no need to use scoop: setup-clojure works on all OSes. |
I keep getting this error from signal(void-variable (/bin/sh:))
apply(signal (void-variable (/bin/sh:)))
(setq value-257 (apply fn-255 args-256))
(unwind-protect (setq value-257 (apply fn-255 args-256)) (setq form-description-259 (nconc (list '(should (equal (clj2el-clj! ...) '...))) (list :form (cons fn-255 args-256)) (if (eql value-257 'ert-form-evaluation-aborted-258) nil (list :value value-257)) (let ((-explainer- (and (symbolp ...) (get ... ...)))) (if -explainer- (progn (list :explanation (apply -explainer- args-256))))))) (ert--signal-should-execution form-description-259)) Any ideas? |
Doesn't ring a bell. Maybe we can split up the PR to get CI working from the PR that adds juxt? |
No never mind, the juxt change seems small enough to this together. Perhaps you can compare what happens in the flycheck-clj-kondo CI compared to here? I'll re-trigger its CI to see if everything is still working over there. |
Just checked and flycheck-clj-kondo runs fine: borkdude/flycheck-clj-kondo@4c7a6c4 Perhaps @ikappaki has some ideas why this PR is failing |
Thanks for the info @borkdude . Upon close inspection, it may have been because I forgot to install Now that I do (via
|
Try to use a newer version of babashka |
Cool, CI passes now. I do have one question though, in a case like this: (clj2el-clj! (let [fns (juxt + -)]
(funcall fns 0 1 2 3 4 5)))
|
Great! Yes, I think we keep track if something is a local, so whenever a local is called, we can insert a funcall |
Actually, I think we also need to cover the case of something like:
So on second thought, could we just add a |
Let's take it issue by issue. Please wrap up the work that this issue was originally about and then we can address the next problem in a separate issue, else it's getting unwieldy :) |
Ah yep, will do |
Fix step name Try manual install Try installing via brew (for linux/mac) Set up scoop Disable windows for now Add missing " Attempt to fix test step Check if /bin/sh exists Revert "Check if /bin/sh exists" This reverts commit 0a076bb. Use clojure Github action instead Try eldev without packaged mode Try eldev github action Find sh executable (so I can symlink it to /bin/sh) Symlink sh to /bin/sh Remove test CI for now Revert "Remove test CI for now" This reverts commit d8fde84. Install bbin and clj2el as executable. Only Mac for now Try latest babashka Install eldev manually Attempt to fix bbin setup Allow me to debug runner via ssh Debug again Another attempt Install bbin manually Remove unused step Re-add ubuntu Re-add windows Remove windows for now
7d791a5
to
9903aaf
Compare
Ok, I've removed windows from the OS matrix for now (having trouble getting I think the rest of the stuff's ready for review |
@anonimitoraf Thanks a lot, excellent first PR! |
Hi, I've addressed the ms-win failrue with #6, thanks. |
Fun project!
I've added an implementation for
juxt
. I'm a bit inexperienced with macros so completely open to feedbackBasic examples I tested with: