Merging this in the next version of bb:
$ ./bb -e '(with-precision 20 :rounding CEILING (/ 1M 3))'
0.33333333333333333334M
:D@mike1452 Now alignment works for me:
https://github.com/clj-kondo/clj-kondo.lsp/blob/master/bb.edn
with (setq clojure-align-separator 'entire)
. Before it would stop aligning after blank lines.
@borkdude 👍. I continue to play with babashka
. Can't stop enjoying it after years with bash, python, groovy.
how to catch output of ?
(babashka.tasks/clojure "-Spath")
I need to build clojure project classpath from deps.edn and send it to javac utility as -cp parameter.huh! yeah, I'm a bit tired today 🙂
well, it only works because it's designed that way, it could have been different
@borkdude, another bb.edn
example for new version of application template
https://github.com/redstarssystems/rssysapp/blob/develop/resources/clj/new/rssysapp/bb.edn
@mike1452 Very cool! Any reason you are not using :depends
rather than (run 'task)
?
You could do this in :init
: (def cformat clojure.core/format)
and then use cformat
in the rest of your tasks, for shorter naming, or (alias 'core 'clojure.core)
yeah, good advices!
:depends
and run
are both good, but I wanted to call another task in particular place in code (or execution time), so I used run
@mike1452 Does this work?
https://github.com/redstarssystems/rssysapp/blob/0763853843973692a7594f90061c6b24d2e1cb3b/resources/clj/new/rssysapp/bb.edn#L85
The File
class is not imported anywhere?
Yes! It works!
You can try it
clojure -X:new :template org.rssys.apptemplate :name com.example/app01
Then create java/src
folder and put there some class like
package com.example;
public class Hello01{
public static void sayHello (){
System.out.println("hello from Hello01");
}
}
Then uncomment "java/src" in deps.edn and call Hello01 from mainI guess bb
was a bit too liberal with its default imports compared to clojure...
bb -e 'File'
java.io.File
$ clj -M -e 'File'
Syntax error compiling at (REPL:0:0).
Unable to resolve symbol: File in this context
because this isn't compatible with normal Clojure, I might revert that so it would probably be better to write java.io.File
ok, I'll rewrite it tomorrow.