This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-24
Channels
- # aleph (1)
- # announcements (22)
- # atom-editor (11)
- # babashka (46)
- # beginners (60)
- # calva (44)
- # cider (18)
- # circleci (1)
- # cljdoc (12)
- # cljs-dev (5)
- # cljsrn (19)
- # clojars (3)
- # clojure (162)
- # clojure-dev (9)
- # clojure-europe (6)
- # clojure-italy (2)
- # clojure-losangeles (2)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (23)
- # clojureremote (1)
- # clojurescript (55)
- # community-development (14)
- # core-async (234)
- # cursive (14)
- # data-science (3)
- # datomic (32)
- # fulcro (5)
- # graalvm (20)
- # graphql (2)
- # hugsql (4)
- # jobs (11)
- # jobs-discuss (2)
- # joker (1)
- # juxt (3)
- # kaocha (1)
- # luminus (1)
- # off-topic (33)
- # pathom (3)
- # pedestal (1)
- # reagent (24)
- # remote-jobs (3)
- # shadow-cljs (38)
- # spacemacs (4)
- # specter (4)
- # speculative (54)
- # tools-deps (62)
- # vim (8)
- # vscode (14)
working here:
$ ./bb "(derive ::foo ::bar) (isa? ::foo ::bar)"
true
are you working toward multimethod support?@borkdude thank you for the inclusion of java.time
in babashka, I'm using it to turn millis into human readable times in streaming data in my terminal
When I use Thread/sleep
or (shell/sh "sleep" "3")
in babashka, and I try to run it through Linux Mint's "Startup Applications", it kills my script at the sleep. It doesn't happen with regular bash scripts containing sleep 3
. Does anyone have any idea about what the difference is? The babashka script works fine in my terminal. I'm stumped.
@oskarkv How are you starting babashka? What if you wrap the call inside a bash script and call the bash script?
No error message. I don't know where they would appear. I looked in /var/log but nothing (with find . -mmin -1
)
i extracted the following cross-platform-ish which
function from a project, and got to thinking whether it could run in babashka:
(defn which
[bin-name]
(let [paths (clojure.string/split (or (System/getenv "PATH") "")
(re-pattern (.File/pathSeparator)))
;; for windows
pathexts (clojure.string/split (or (System/getenv "PATHEXT") "")
(re-pattern (.File/pathSeparator)))]
;; adapted work by taylorwood
(first
(for [path (distinct paths)
pathext pathexts
:let [exe-file ( path (str bin-name pathext))]
:when (.exists exe-file)]
(.getAbsolutePath exe-file)))))
when i try to run it via bb, i currently get something like:
clojure.lang.ExceptionInfo: No matching method pathSeparator found taking 0 args
probably missing a reflection thing, but you can also do (System/getProperty "path.separator")
seems to work on windows too. here's an updated version: https://gist.github.com/sogaiu/0c542ee238858adfe33f1200e3a86634
@borkdude i looked at reflection.json -- for http://java.io.File here it has:
{
"name" : ".File",
"allPublicMethods" : true,
"allPublicFields" : true,
"allPublicConstructors" : true
}
at least some of oracle's docs list pathSeparator
as a static field. my initial thought was that allPublicFields
ought to cover it.
does it seem like i'm missing something?ah, good point about calling as a method. don't know why i was doing that 🙂 it is a bit odd that that works in jvm clojure.
maybe because (. Classname staticField)
works, and that's what it expands to. maybe I should support that in bb then... although maybe not
my vote would be wait to decide -- if it comes up in some use case involving an existing library or something may be that's not a bad time to revisit?
@sogaiu I opened an issue and closed it again. It's just there for reference now, until we hit it as a problem: https://github.com/borkdude/sci/issues/257