@jsx610278856 has joined the channel
When a macro id is used in an expression position, there is simple bad syntax
error. Is there a way to change that message?
yes, your macro can handle that case and produce whatever message you want
Is there a way to change that message for macros that I don’t define?
@gkostejko has joined the channel
I don’t understand why this preference follows from the rule “prefer to break at the highest level of syntactic nesting”—or is the example buggy maybe?
This is a nice rule, but how do you reconcile it with not having closing brackets on separated lines?
@ckipp has joined the channel
breaking at the outer match clause in addition to the inner match clause
Case covered :)
For symmetry?
Okay now that I’ve actually woken up I can explain what I meant here better
I’m assuming that the pat1
, pat2
, body1
, and body2
forms are complex enough that they can’t all fit on one line
So the rule I follow is basically, jam everything onto one line, then insert linebreaks until I’m under the column limit. When picking where to put a linebreak, I always start with the outermost forms.
(match exp [pat1 (match exp [pat1 body1] [pat2 body2])])
=>
(match exp
[pat1 (match exp [pat1 body1] [pat2 body2])])
=>
(match exp
[pat1
(match exp [pat1 body1] [pat2 body2])])
=>
(match exp
[pat1
(match exp
[pat1 body1]
[pat2 body2])])
=>
(match exp
[pat1
(match exp
[pat1
body1]
[pat2
body2])])
and I have some miscellenaeous extra constraints I throw in, like if a match
expression needs multiple lines, I never put two pattern-body clauses on the same line
so I wouldn’t write this, for example: (match exp
[pat1 body1] [pat2 body2])
I just generalize it to “you can ignore an expression’s “punctuation” when determining its bounding box”
where “punctuation” is a somewhat fuzzy category that I have decided includes parentheses
How does the rectangle rule apply here? Don’t all four of these follow it already?
yes, I forgot that the “prefer to break at the highest level of syntactic nesting” thing is separate from the rectangle rule