Fork me on GitHub
#beginners
<
2019-06-02
>
Kari Marttila19:06:02

Are there someone who uses the Flambo Spark library? I was planning to learn Spark with Clojure and I'm considering to use Flambo. There was just this problem that when following the Flambo tutorial I immediately got stuck with something (more about it in the #flambo channel). I also git cloned the flambo project and tried to lein test and there were some test errors. How mature is that library? Are there other Clojure Spark libraries?

Kari Marttila19:06:31

Are there some experiences regarding Flambo vs Sparkling?

nmkip19:06:04

Hi, where's my mistake?

nmkip19:06:37

(eval `(let [a# 3] a#))

didibus21:06:34

What doesn't work?

ghadi21:06:30

type

`(let [a 3] a)
into your REPL and you'll see where it goes wrong

ghadi21:06:30

(the spec error you shortened tells you exactly what is wrong)

nmkip22:06:06

ofc I ran it in the repl, the problem is something with a

lilactown22:06:14

I was confused with @ghadi’s explanation as well

lilactown22:06:24

it’s because the expansion namespaces the a symbol

lilactown22:06:40

you get:

(let [user/a 3] user/a)

lilactown22:06:06

however, that’s invalid

lilactown22:06:23

you can’t create namespaced let bindings

lilactown22:06:59

the spec error he was talking about:

user/a - failed: simple-symbol? at: [:bindings :form :local-symbol] spec: :clojure.core.specs.alpha/local-name
which isn’t terribly explanatory but does make sense, once you know what’s wrong :)

lilactown22:06:34

(`simple-symbol?` probably means, “isn’t namespaced”)

nmkip23:06:29

yes, I also understood that. Solved it using a#

ghadi23:06:10

clojure.core/simple-symbol? Return true if x is a symbol without a namespace

ghadi23:06:33

I'd argue that that error message is almost perfectly descriptive

ghadi23:06:15

It's saying that a value user/a failed that predicate

ghadi23:06:01

But that's speaking with some knowledge that macros are checked against specs, and that 'let' is a macro...

ghadi23:06:34

When in doubt, deconstruct the problem

didibus23:06:44

Interesting, works fine in Clojure 1.7 😋