Hi @pez, I see there is bad highlight syntax when use #_#_
. (get-in ...)
should be also commented
hmm I guess you prefer to make it on github instead of here
So, what is that, an ignored ignored form?
TIL
cljs.user=> (let [#_id (+ 1 2)]
#_=> )
Unexpected error (ExceptionInfo) macroexpanding cljs.core$macros/let at (<cljs repl>:1:1).
let requires an even number of forms in binding vector
cljs.user=> (let [#_#_id (+ 1 2)])
nil
cljs.user=> (+ 1 #_#_1 1 1)
2
cljs.user=> (+ 1 #_#_1 1 )
1
Yeah, so the error in the highlighting is that composite-id
is dimmed, right?
I believe #_ comments out one form
so ## should dimm out two forms
exactly
#_#_
cljs.user=> (+ 1 #_#_1 1 1)
2
Like here it commented out two 1's(+ 1 #_#_1 1 1) === (+ 1 #_1 #_1 1)
if this makes more senseHmmm, wow.
OK so:
[#_#_id (+ 1 2)] === []
Right?yes
Cool. Thanks. I'll see what I can do about it.
cljs.user=> (= [#_#_id (+ 1 2)] [])
true
🙂
Why is it like that? My brain hurts a bit.
user=> (= [#_#_#_#_ 1 2 3 4] [])
true
you know how you acn do stuff like
#_ (foo)
and it will still comment out (foo)
Yeah
so now think of it in a way that in ##1 2 first discard macro will discard the 1 and the second one will have nothing in front of it but 2, so it will discard 2
so I think the #_ looks in front of it till it finds something and comments it out
and something that is not there
cannot be discarded twice?
now my brain hurts
😄
It seems like it is read like so (conceptually):
#_(#_ 1) 2
And then... ouch....
#_(#_(#_(#_ 1) 2) 3) 4
I think it will prove a bit difficult to make my parser handle this...
(let [#_#_product (fetch-product 1
extra line of parameters
true false :promotion)
product (fetch-product-v2 1)]
...)
^ general use case is to comment out something during testing
also with cond->
etc.I think this above cover 95% of use cases?
so the point of using #_#_
is to easy deal with comment multi lines
see also adding ;
would comment let [
Got it. I’m trying to see if I can fix it.
Getting there. We’ll see if I make it the whole way. 😃