This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-24
Channels
- # babashka (19)
- # beginners (43)
- # calva (10)
- # clj-kondo (3)
- # cljsrn (8)
- # clojure (106)
- # clojure-europe (8)
- # clojure-hungary (5)
- # clojure-nl (1)
- # clojure-uk (1)
- # clojurescript (14)
- # core-typed (1)
- # graalvm (2)
- # graphql (1)
- # malli (2)
- # membrane (9)
- # observability (2)
- # off-topic (66)
- # polylith (3)
- # practicalli (3)
- # re-frame (17)
- # reagent (3)
- # remote-jobs (7)
- # rewrite-clj (17)
- # sci (29)
- # shadow-cljs (45)
- # sql (5)
- # tools-deps (15)
- # vim (8)
@yubrshen do you mean using the PI value, abs and cosine functions? If yes, using the (Math/abs n)
, (Math/cos n)
and (Math/PI)
work in bb. They are from the standard java library
Yes. Thanks. What's the :deps expression in deps.edn and in (:require ) expression to use Math namespace for Clojure, as I have to use Clojure with Cider/Emacs/Repl tool chain to do the development, and tests. By the way, using clojure.algo.generic also worked.
Math is imported directly as its part of java.lang and all are imported for you. Can directly use (Math/func ...)
Also its a java class and for java classes which are not automatically imported you need to use https://clojuredocs.org/clojure.core/import
Playing with process again today, not sure why/how, I am getting this error (only in CI, seen with bb 0.4.6 and 0.5.0). Seems like this line https://github.com/babashka/process/blob/4fdf33c0243ff646dfa91c4454844a33e0f025b0/src/babashka/process.clj#L233 and then going into the clj source’s own multimethod https://github.com/clojure/clojure/blob/b1b88dd25373a86e41310a525a21b497799dbbf2/src/clj/clojure/java/io.clj#L406 Not reproducing locally yet so a bit puzzled, putting it here in case someone has an idea
#error {
:cause No method in multimethod 'do-copy' for dispatch value: [java.lang.ProcessImpl$ProcessPipeInputStream sci.impl.fns$fun$arity_1__1213]
:via
[{:type java.util.concurrent.ExecutionException
:message java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No method in multimethod 'do-copy' for dispatch value: [java.lang.ProcessImpl$ProcessPipeInputStream sci.impl.fns$fun$arity_1__1213]
:at [java.util.concurrent.FutureTask report FutureTask.java 122]}
{:type java.util.concurrent.ExecutionException
:message java.lang.IllegalArgumentException: No method in multimethod 'do-copy' for dispatch value: [java.lang.ProcessImpl$ProcessPipeInputStream sci.impl.fns$fun$arity_1__1213]
:at [java.util.concurrent.FutureTask report FutureTask.java 122]}
{:type java.lang.IllegalArgumentException
:message No method in multimethod 'do-copy' for dispatch value: [java.lang.ProcessImpl$ProcessPipeInputStream sci.impl.fns$fun$arity_1__1213]
:at [clojure.lang.MultiFn getFn MultiFn.java 156]}]
:trace
[[clojure.lang.MultiFn getFn MultiFn.java 156]
[clojure.lang.MultiFn invoke MultiFn.java 238]
[$copy invokeStatic io.clj 406]
[babashka.process$copy invokeStatic process.clj 197]
[babashka.process$process$fn__28497 invoke process.clj 233]
[clojure.core$binding_conveyor_fn$fn__5773 invoke core.clj 2034]
[clojure.lang.AFn call AFn.java 18]
[java.util.concurrent.FutureTask run FutureTask.java 264]
[java.util.concurrent.ThreadPoolExecutor runWorker ThreadPoolExecutor.java 1128]
[java.util.concurrent.ThreadPoolExecutor$Worker run ThreadPoolExecutor.java 628]
[java.lang.Thread run Thread.java 829]
[com.oracle.svm.core.thread.JavaThreads threadStartRoutine JavaThreads.java 553]
[com.oracle.svm.core.posix.thread.PosixJavaThreads pthreadStartRoutine PosixJavaThreads.java 192]]}
@nha With a repro I would be better able to help you. The copy comes from io/copy
which is implemented using a multimethod in
gah.. it’ user error after all 😕
(-> (process '[echo "something"]
{:out (fn [_]
;; ...
)})
(check))
for context, I am making a my-process
fn that accepts functions but was calling babshka.process/process
instead
Hello, anyone can help me with this? I want to use fxl to handle excel files. Seems like bb doesn’t support this library.
@zhoumin79 hi! bb only supports libraries that are based on the standard clojure + Java libraries (or built-in libraries) so unfortunately you can't load this excel library from source
@zhoumin79 a workaround is e.g. installing csvkit which I think supports transforming an excel to csv and vice versa
@borkdude thanks. BB is a great tool for automating work. CSV does work. I have used it. But I have many sheets with releations in one excel file. I want to use bb script to do with them. Could you create a Fxl pod later? Fxl is also a nice library to deal with excel data.
Ah, I didn't know this library, but it's worth a look. Could you post a "discussion" about this on the Github Discussion board under Ideas?
Ok, I will post a dicussion. Thank you very much.
@zhoumin79 what I meant before is that it's currently an option to use https://csvkit.readthedocs.io/en/latest/scripts/in2csv.html to convert an excel sheet to CSV and then do the processing in bb
yes. I use bb script with [clojure.data.csv :as csv] to work with csv. It works great. But Excel with many sheets is more useful. Thanks.