Fork me on GitHub
#malli
<
2020-11-12
>
Rodrigo A. Roveri14:11:09

Folks, I have a begginer's question. I would like to test Malli, so I created a new lein project and included malli in the dependencies. I was able to run lein repl, but was unable to follow the examples on the doc page. (see image below) Am I missing something? Some pre-requisite? I tested on these two versions "0.0.1-SNAPSHOT", "0.2.1".

borkdude14:11:08

What does the exception preceding your REPL expressions say?

borkdude14:11:02

How are you starting this repl? what is in your project.clj?

Rodrigo A. Roveri14:11:22

Oh oh. I think maybe I know the answer. My project is also named "malli":man-facepalming:

👍 6
Rodrigo A. Roveri14:11:07

Thank you very much. Keep up the good work. I will run some tests. The project seems really interesting!

👍 3
ikitommi17:11:10

@maciej.falski oh, that’s bad, didn’t realize that unregistered Schemas can’t be walked with the current impl of m/schema-walker, as it tries to recreate the schmas using m/type, which in this case is :user/over6 and not found in the registry.

ikitommi17:11:33

Might need to add a -copy method into Schema protocol.

ikitommi17:11:42

good thing is, that a per-schema -copy is most likely near to no-op, which makes Schema walking easily order(s) of magnitude faster.

Maciej Falski17:11:02

Not sure if it’s about the registry, ie:

(mr/set-default-registry!
  {:string (m/-string-schema)
   :over6 Over6})
=> #object[malli.registry$simple_registry$reify__4072 0x1f74f3fd "malli.registry$simple_registry$reify__4072@1f74f3fd"]
(mu/closed-schema :string)
=> :string
(mu/closed-schema :over6)
Execution error (ExceptionInfo) at malli.core/-fail! (core.cljc:79).
:malli.core/invalid-schema {:schema :user/over6}

ikitommi17:11:10

@maciej.falski you should register it with :user/over6 so it matches the Schema definition

👍 3