This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-01
Channels
- # announcements (2)
- # babashka (10)
- # beginners (133)
- # calva (28)
- # cestmeetup (1)
- # chlorine-clover (31)
- # cider (21)
- # clj-kondo (29)
- # cljs-dev (252)
- # clojure (60)
- # clojure-europe (24)
- # clojure-nl (3)
- # clojure-spec (13)
- # clojure-uk (17)
- # clojurescript (47)
- # conjure (20)
- # datascript (2)
- # datomic (4)
- # figwheel-main (4)
- # fulcro (71)
- # helix (16)
- # jobs (1)
- # meander (56)
- # mount (1)
- # off-topic (15)
- # pathom (25)
- # re-frame (17)
- # reagent (5)
- # remote-jobs (1)
- # shadow-cljs (92)
- # sql (10)
- # tools-deps (71)
- # xtdb (14)
@noprompt For something like:
{:a ?a :b ?b} (+ ?b 10)
?a would be unused, but you're using it to ensure :a is present… Although maybe I'm doing it wrong :)@noprompt Ah, so maybe my hack is sufficient then. If I get some energy I'll play around with it.
Going back and forth here on the most delicate way to express this but, eh, I can’t tactfully say it better: that macroexpand idea is a mixed bag.
It's a difficult set of constraints to balance. I'm thinking that core.match and meander are probably the major use-cases for it.
I stopped using clj-kondo because of all the complaints about variables it didn’t understand in macros.
I made a thing for code search/replace about a year ago but I never made it into a solid stand alone thing.
Ultimately, whatever we would implement only need be "good enough" that 99% of my annoyances with meander linting go away :)
let me know if you figure it out, clojure-lsp has to keep expanding it's macro-defs for handling the problem 😞
@snoe I’m putting a sticky on my monitor to remind me to get familiar with clojure-lsp this week.
@noprompt you can, yeah. But it's nice to get some feedback within those forms. Consider my try+, I'd have to disable linting in the whole try+ macro, so it wouldn't catch this:
(try+
(let [x] …))
Macros can have arbitrary code run which is super powerful but comes at the expense of increased analysis difficulty.
I wanted to add defnotation
which would basically be a symbolic rewrite rule instead of one that executes code.
The advantage is that there is no code which can interfere with determining the shape of data coming out of the transform.
Here’s the delta interpreter: https://gist.github.com/noprompt/085d100de4e85d7b643e438498e08b56
zeta
kinda works both ways where the macro compiler uses the interpreter API when it as to and more advanced compilation moves when it can.
epsilon
probably should have been designed this way from the start but I started at “make a pattern matcher like core match that I maintain”
With the ability to configure the compiler/parser/etc soon we can indicate that a map is strict.
The decision to place the constraint on value is 99% due to the fact there is no operational/observable difference between (get {} :a)
and (get {:a nil} :a)
.
Right. It was a decision I made early on. The tradeoff of matching on the result of get
is this situation.
BTW, if folks have any thoughts/ideas for flags share them on this PR: https://github.com/noprompt/meander/pull/124
My primary goal for this patch at the moment is to be able to completely move any AST manipulation out of the matrix compiler and into the match syntax namespace and then have flags to turn them on/off
I just realized we were talking past each other. https://cljdoc.org/d/meander/epsilon/0.0.421/doc/operator-overview#logic-variables title is optional in this example. I thought it was required.