Fork me on GitHub
#meander
<
2020-07-19
>
ikrimael13:07:18

Yeah, probably different learning styles (ex: I looked up how closures are implemented before using them) I think there's still probably utility in highlevel explanation (like the link and your description two paragraphs ago on logic/memory fvars)

ikrimael13:07:53

for me, the disconnect is mostly in the "magical joins and constraint satisfiability" and in turn, what governs if something will be emitted multiple times or if it will be used as a constraint

noprompt19:07:47

I think the interpreter could be instrumental in helping someone understand one way the semantics can be implemented.

9
Jimmy Miller19:07:59

Yeah I guess that is more my point. The semantics really matter. An interpreter is definitely a decent way to learn those. But in my view the goal is to understand those semantics more than it is to have a good idea of how meander is working under the hood.

☝️ 3
noprompt19:07:34

And I think you know that I share that bias. Meaning is key.

noprompt19:07:03

Another key thing is being able to map, structurally, implementation details.

noprompt19:07:24

But I’m dangerously close to rambling. 🙂

ribelo20:07:27

I found a strange behavior that I can't understand

ribelo20:07:24

[[:single-match
  (m/find {:a 1 :b 2}
    (m/map-of !k !v) :work!)]
 [:single-match-with-catch-all
  (m/find {:a 1 :b 2}
    (m/map-of !k !v) :work!
    _ :error)]
 [:multiple-match
  (m/find {:a 1 :b 2}
    (m/pred integer?) :_
    (m/map-of (m/pred int?) (m/pred int?)) :_
    (m/map-of !k !v) :work!)]
 [:multiple-match-with-catch-all
  (m/find {:a 1 :b 2}
    (m/pred integer?) :_
    (m/map-of (m/pred int?) (m/pred int?)) :_
    (m/and ?mfn (m/map-of !k !v)) :work!
    _ :error)]]

;; => [[:single-match :work!]
;;     [:single-match-with-catch-all :work!]
;;     [:multiple-match :work!]
;;     [:multiple-match-with-catch-all :error]]

Jimmy Miller20:07:04

Just fyi doing wrapping the code in ` (no spaces escapes don't seem to work so I did that.) will help it format better.

[[:single-match
  (m/find {:a 1 :b 2}
    (m/map-of !k !v) :work!)]
 [:single-match-with-catch-all
  (m/find {:a 1 :b 2}
    (m/map-of !k !v) :work!
    _ :error)]
 [:multiple-match
  (m/find {:a 1 :b 2}
    (m/pred integer?) :_
    (m/map-of (m/pred int?) (m/pred int?)) :_
    (m/map-of !k !v) :work!)]
 [:multiple-match-with-catch-all
  (m/find {:a 1 :b 2}
    (m/pred integer?) :_
    (m/map-of (m/pred int?) (m/pred int?)) :_
    (m/and ?mfn (m/map-of !k !v)) :work!
    _ :error)]]

;; => [[:single-match :work!]
;;     [:single-match-with-catch-all :work!]
;;     [:multiple-match :work!]
;;     [:multiple-match-with-catch-all :error]]
Let me take a look at what is going on, there is a lot here.

Jimmy Miller20:07:29

What version of meander are you using?

ribelo20:07:50

meander/epsilon      {:mvn/version "0.0.469"}

Jimmy Miller20:07:32

Seems like a regression to me. I had an old version open and it worked totally fine. Just tried with latest and it does have the error, which seems wrong to me.

Jimmy Miller20:07:53

Yeah, I'm sorry about that bug. I am going to look at it a bit and see if I can uncover the problem. In "0.0.421" it worked fine for me.

ribelo20:07:18

I'm gonna add the dependency using the git and try again

ribelo20:07:06

It's an amazing piece of code and I'm having a lot of fun playing with it

ribelo20:07:29

thanks for that

Jimmy Miller21:07:16

Yeah, it looks like search is finding an extra value that I don't think should be there. And if it should, it is in the wrong order. I'm guessing it has to do with some recent changes to the search stuff. I probably won't be able to fix it right now, but glad you have work around for the time being. If you have time to make a github issue that would be great, if not I will do that soon.

Jimmy Miller21:07:44

Glad that you are enjoying it. Always sad when people discover bugs not caught by our test suite, but that gives us another case to add. Thanks

ribelo21:07:57

I'll add in a minute

🙂 3
noprompt22:07:32

I think I know what’s causing that bug.

noprompt22:07:28

When I have an opportunity, I’ll take a look at this.