This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-08
Channels
- # announcements (5)
- # babashka (46)
- # beginners (32)
- # calva (9)
- # chlorine-clover (4)
- # clojars (31)
- # clojure (83)
- # clojure-italy (1)
- # clojure-nl (1)
- # clojure-spec (13)
- # clojure-uk (12)
- # clojuredesign-podcast (1)
- # clojurescript (30)
- # cursive (3)
- # fulcro (18)
- # graalvm (6)
- # graphql (2)
- # jobs-discuss (6)
- # joker (4)
- # malli (1)
- # nrepl (1)
- # off-topic (15)
- # shadow-cljs (2)
- # spacemacs (3)
- # tree-sitter (19)
- # vim (1)
- # vscode (7)
@deleted-user re: shelling out -- symlinks are also not going to be doable for windows via an lts jvm until jdk 17 iiuc. i think jdk 14 might get them, but that's not lts.
by "get them", i mean have them in a state that it might actually be possible to use them on windows. the api is there already (may be in 11 even?), but apparently there is some technical issue with them not working iiuc.
it would be nice to not have to shell out for things though because that makes the code more likely to be platform dependent...however, since windows seems to have gotten curl in some form (and tar?), perhaps it's possible to get the things being "shelled out to" to somehow be common across platforms (or at least mostly so).
@porkostomus Wow, awesome!!
@sogaiu @deleted-user I added babashka.curl because I either had to add clj-http-lite which can't do everything (like patch request it cannot do) or hato which bloats the binary and compile times. This is why I opted for the lighter solution babashka.curl which seems to be sufficient for most common scripting needs. If there are problems with the Windows curl version I'd be happy to support them via a platform-specific check.
@porkostomus i guess it's now bb -f forebb.clj
and not bb -f 4bb.clj
?
that's just the name of the namespace, since it can't start w/ a number
@porkostomus Might be worth mentioning in #beginners and #announcements
@porkostomus Somehow for answer 8 it doesn't accept my input:
#{:a :b :c :d}
$ clojure 4bb.clj
#8: Sets
Sets are collections of unique values.
(= __ (set '(:a :a :b :c :c :c :c :d :d)))
(= __ (clojure.set/union #{:a :b :c} #{:b :c :d}))
#{:a :b :c :d}
Sorry, try again...
#8: Sets
Sets are collections of unique values.
(= __ (set '(:a :a :b :c :c :c :c :d :d)))
(= __ (clojure.set/union #{:a :b :c} #{:b :c :d}))
$ rlwrap bb 4bb.clj
#8: Sets
Sets are collections of unique values.
(= __ (set '(:a :a :b :c :c :c :c :d :d)))
(= __ (clojure.set/union #{:a :b :c} #{:b :c :d}))
#{:a :b :c :d}
NICE! Here's the next one:
#9: conj on sets
When operating on a set,
the conj function returns a new set with one or more keys "added".
(= #{1 2 3 4} (conj #{1 4 3} __))
wow interesting
in clojure
I'm getting this exception:
#{:a :b :c :d}
"replaced" ("(= #{:a :b :c :d} (set '(:a :a :b :c :c :c :c :d :d)))" "(= #{:a :b :c :d} (clojure.set/union #{:a :b :c} #{:b :c :d}))")
#error {
:cause "clojure.set"
:via
[{:type clojure.lang.Compiler$CompilerException
:message "Syntax error compiling at (/private/tmp/4bb/4bb.clj:1912:1)."
:data #:clojure.error{:phase :compile-syntax-check, :line 1912, :column 1, :source "/private/tmp/4bb/4bb.clj"}
:at [clojure.lang.Compiler analyzeSeq "Compiler.java" 7115]}
{:type java.lang.ClassNotFoundException
:message "clojure.set"
:at [.URLClassLoader findClass "URLClassLoader.java" 471]}]
Although this works:
$ clj
Clojure 1.10.1
user=> (eval (read-string "#{:a :b :c :d}"))
#{:c :b :d :a}
could it be bc the ns doesn't match the filename?
oh I see, that makes sense
I actually just received the smallest PR possible... someone reset it back to 1.
but you could also write it to ~/.config/4bb/prob_num or something. either is fine with me
hmm, yeah that could work too. I don't really have a strong opinion either
The risk of keeping it under source control is that people make PRs where this number is set to something different again 😉
I think I'll add actual options to reset progress, run a specific problem or a random one, then it would make more sense to "hide" it, like a cookie
added 4bb to the readme: https://github.com/borkdude/babashka/#4bb
awesome!!
@porkostomus Added unit tests: https://github.com/porkostomus/4bb/pull/3
Also works with clojure
:
$ clojure tests.clj
Testing forebb_test
Ran 1 tests containing 42 assertions.
0 failures, 0 errors.
Wow, that's great! Thank you!