This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-18
Channels
- # announcements (35)
- # babashka (31)
- # beginners (77)
- # biff (23)
- # calva (1)
- # clj-kondo (4)
- # cljsrn (3)
- # clojure (71)
- # clojure-dev (9)
- # clojure-europe (51)
- # clojure-france (3)
- # clojure-germany (1)
- # clojure-nl (3)
- # clojure-spec (9)
- # clojure-uk (42)
- # clojurescript (24)
- # clojureverse-ops (3)
- # component (16)
- # cursive (1)
- # data-science (8)
- # emacs (1)
- # fulcro (5)
- # graalvm-mobile (1)
- # graphql (2)
- # honeysql (36)
- # leiningen (3)
- # malli (3)
- # off-topic (16)
- # remote-jobs (1)
- # sql (3)
- # testing (19)
- # tools-deps (11)
- # xtdb (20)
Hey Borkdude I just rewrote my https://github.com/rafaeldelboni/dotfiles/tree/master/config/i3blocks/scripts using babashka instead of bash and is incredible, thanks a lot for all your work and enabling us to move out the ugly bashscripts 😄
Btw, feel free to post it here: https://github.com/babashka/babashka/discussions/categories/show-and-tell I think the Github Discussions board can be a nice place to share this stuff as well.
Ah ok I will, thanks
Did anything cool with babashka? Consider sharing it here: https://github.com/babashka/babashka/discussions/categories/show-and-tell
I'm a getting a stack trace as the result of a function chain, but no idea in where / which function it has occurred. Is there a way to improve it ?
#error {
:cause nil
:via
[{:type java.lang.NullPointerException
:message nil
:at [clojure.lang.Numbers ops Numbers.java 1068]}]
:trace
[[clojure.lang.Numbers ops Numbers.java 1068]
[clojure.lang.Numbers isZero Numbers.java 117]
[clojure.core$zero_QMARK_ invokeStatic core.clj 874]
[clojure.core$zero_QMARK_ invoke core.clj 869]
[sci.impl.analyzer$return_call$fn__18447 invoke analyzer.cljc 811] etc...
@dennisa when you invoke the script from the command line you will likely get a better error message
are you using the nREPL btw? please provide as much info as you can about your environment
#error {
:cause nil
:via
[{:type java.lang.NullPointerException
:message nil
:at [clojure.lang.Numbers ops Numbers.java 1068]}]
:trace
[[clojure.lang.Numbers ops Numbers.java 1068]
[clojure.lang.Numbers isZero Numbers.java 117]
[clojure.core$zero_QMARK_ invokeStatic core.clj 874]
[clojure.core$zero_QMARK_ invoke core.clj 869]
[sci.impl.analyzer$return_call$fn__18447 invoke analyzer.cljc 811]
[sci.impl.evaluator$eval invokeStatic evaluator.cljc 390]
[sci.impl.analyzer$return_if$fn__18211 invoke analyzer.cljc 462]
[sci.impl.evaluator$eval invokeStatic evaluator.cljc 390]
[sci.impl.evaluator$eval invoke evaluator.cljc 385]
[sci.impl.evaluator$eval_let$fn__17163 invoke evaluator.cljc 68]
[sci.impl.evaluator$eval_let invokeStatic evaluator.cljc 62]
[sci.impl.analyzer$expand_let_STAR_$fn__18173 invoke analyzer.cljc 338]
[sci.impl.evaluator$eval invokeStatic evaluator.cljc 390]
[sci.impl.evaluator$eval invoke evaluator.cljc 385]
[sci.impl.evaluator$eval_try invokeStatic evaluat
or.cljc 133]
[sci.impl.evaluator$eval invokeStatic evaluator.cljc 403]
[sci.impl.analyzer$return_do$fn__17612 invoke analyzer.cljc 117]
[sci.impl.evaluator$eval invokeStatic evaluator.cljc 390]
[sci.impl.evaluator$eval invoke evaluator.cljc 385]
[sci.impl.fns$fun$arity_4__16544 invoke fns.cljc 149]
[sci.impl.vars.SciVar invoke vars.cljc 321]
[sci.impl.analyzer$return_call$fn__18453 invoke analyzer.cljc 811]
[sci.impl.evaluator$eval invokeStatic evaluator.cljc 390]
[sci.impl.evaluator$eval invoke evaluator.cljc 385]
[sci.impl.evaluator$eval_let$fn__17163 invoke evaluator.cljc 68]
[sci.impl.evaluator$eval_let invokeStatic evaluator.cljc 62]
[sci.impl.analyzer$expand_let_STAR_$fn__18173 invoke analyzer.cljc 338]
[sci.impl.evaluator$eval invokeStatic evaluator.cljc 390]
[sci.impl.evaluator$eval invoke evaluator.cljc 385]
[sci.impl.fns$fun$arity_2__16520 invoke fns.cljc 141]
[sci.impl.vars.SciVar invoke vars.cljc 317]
[sci.impl.analyzer$return_call$fn__18449 invoke analyzer.cljc 8
11]
[sci.impl.evaluator$eval invokeStatic evaluator.cljc 390]
[sci.impl.interpreter$eval_form invokeStatic interpreter.cljc 77]
[sci.core$eval_form invokeStatic core.cljc 257]
[babashka.nrepl.impl.server$eval_msg$fn__30614 invoke server.clj 44]
[babashka.nrepl.impl.server$eval_msg invokeStatic server.clj 32]
[babashka.nrepl.impl.server$session_loop invokeStatic server.clj 223]
[babashka.nrepl.impl.server$listen$fn__30688 invoke server.clj 264]
[sci.impl.vars$binding_conveyor_fn$fn__8727 invoke vars.cljc 147]
[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 834]
[com.oracle.svm.core.thread.JavaThreads threadStartRoutine JavaThreads.java 519]
[com.oracle.svm.core.posix.thread.Pos
ixJavaThreads pthreadStartRoutine PosixJavaThreads.java 192]]}
when invoking the script from the command line you will get a proper stack trace from bb itself
when I evaluate:
(defn foo []
(zero? nil))
(foo)
I see
clojure.lang.ExceptionInfo: null
{:type :sci/error, :line 4, :column 3, :message nil, :sci.impl/callstack #object[clojure.lang.Delay 0x4e72f87f {:status :pending, :val nil}], :file "\n\n(defn foo []\n (zero? nil))\n", :locals {}}
as the first linesbut with the command line get:
$ bb /tmp/foo.clj
----- Error --------------------------------------------------------------------
Type: java.lang.NullPointerException
Location: /tmp/foo.clj:4:3
----- Context ------------------------------------------------------------------
1:
2:
3: (defn foo []
4: (zero? nil))
^---
5:
6: (foo)
----- Stack trace --------------------------------------------------------------
clojure.core/zero? - <built-in>
user/foo - /tmp/foo.clj:4:3
user/foo - /tmp/foo.clj:3:1
user - /tmp/foo.clj:6:1
Is there some Babashka-compatible templating engine for Clojure?
When I say templating engine, I mean for instance ERB in Ruby (`<%= eval_expr(whatevs) %>`) or <?php
in PHP.
What I'm trying to do: I have a README template which is inherits a lot of data from the monorepo's README, but needs substituting some project-specific stuff.
@jakub.stastny.pt_serv babashka has Selmer built-in :)
Great! Thanks @borkdude!