Fork me on GitHub
#calva
<
2023-03-09
>
pez20:03:39

Dear Calva-friends, there was an issue posted today about the behaviour of the important Calva command Expand Selection. It behaves a bit funny around ignored forms. The issue also asked about the general expectations on the command, which touches on the even more important concept of the Current Form. This is explained on https://calva.io/eval-tips/#current-form and on https://www.youtube.com/watch?v=8ygw7LLLU1w, but I found some time to explain it again a bit, in a slightly different way. Might move it to the Calva documentation later. Anyway, could be a good to have a read: https://github.com/BetterThanTomorrow/calva/issues/2100

DrLjótsson07:03:09

I don't think #_ should be treated as a form but rather as enclosing brackets (like []). So selecting current form in #_fo|o -> foo and growing the selection -> #_foo.

2
pez09:03:36

That makes a lot of sense. Still, I want it to keep the Current Form contract, so e.g. Drag Sexp Backwards should do the right thing. With both the current (`# is treated as a form) and with your suggestion, it will drag: #|foo` -> |foo #_. Which might or might not make sense... And for Evaluate Current Form,.. It's the evaluate current form case that's behind the current state of affairs, because it very seldom makes sense to evaluate an ignored form with the ignore marker. I think it also might be good to consider other reader tags. Calva treats those as part of the form. So: #foo |foo -> #foo foo . And #foo #bar |foo -> #foo #bar foo. This I think still makes sense, given that I want the Current Form to be consistent. Evaluating such a form without its reader tag isn't super, and dragging it without it would be weird as well. There's something very special with the #_ reader tag. 😃 I haven't quite wrapped my head around it.