malli

https://github.com/metosin/malli :malli:
Rodrigo A. Roveri 2020-11-12T14:24:09.028300Z

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".

Rodrigo A. Roveri 2020-11-12T14:24:14.028500Z

borkdude 2020-11-12T14:34:08.029Z

What does the exception preceding your REPL expressions say?

Rodrigo A. Roveri 2020-11-12T14:53:26.029400Z

Rodrigo A. Roveri 2020-11-12T14:53:44.029800Z

@borkdude

borkdude 2020-11-12T14:54:02.030200Z

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

Rodrigo A. Roveri 2020-11-12T14:56:22.031500Z

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

2👍
Rodrigo A. Roveri 2020-11-12T14:57:04.031800Z

#inception

Rodrigo A. Roveri 2020-11-12T14:58:07.032800Z

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

1👍
ikitommi 2020-11-12T17:13:10.035Z

@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.

ikitommi 2020-11-12T17:13:33.035600Z

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

ikitommi 2020-11-12T17:14:42.036800Z

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 Falski 2020-11-12T17:37:02.040300Z

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}

ikitommi 2020-11-12T17:42:10.041500Z

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

1👍