jsx610278856
2020-12-4 11:02:48

@jsx610278856 has joined the channel


kellysmith12.21
2020-12-4 15:18:02

When a macro id is used in an expression position, there is simple bad syntax error. Is there a way to change that message?


samth
2020-12-4 15:24:05

yes, your macro can handle that case and produce whatever message you want


kellysmith12.21
2020-12-4 15:28:40

Is there a way to change that message for macros that I don’t define?


gkostejko
2020-12-4 16:50:45

@gkostejko has joined the channel


laurent.orseau
2020-12-4 17:07:14

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?


laurent.orseau
2020-12-4 17:08:10

This is a nice rule, but how do you reconcile it with not having closing brackets on separated lines?


ckipp
2020-12-4 20:21:16

@ckipp has joined the channel



notjack
2020-12-4 20:53:23

breaking at the outer match clause in addition to the inner match clause


laurent.orseau
2020-12-4 21:01:06

Case covered :)


laurent.orseau
2020-12-4 21:01:58

For symmetry?


notjack
2020-12-4 23:52:26

Okay now that I’ve actually woken up I can explain what I meant here better


notjack
2020-12-4 23:53:15

I’m assuming that the pat1, pat2, body1, and body2 forms are complex enough that they can’t all fit on one line


notjack
2020-12-4 23:54:26

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.


notjack
2020-12-4 23:56:12

(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])])


notjack
2020-12-4 23:56:50

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


notjack
2020-12-4 23:57:13

so I wouldn’t write this, for example: (match exp [pat1 body1] [pat2 body2])


notjack
2020-12-4 23:58:02

I just generalize it to “you can ignore an expression’s “punctuation” when determining its bounding box”


notjack
2020-12-4 23:58:20

where “punctuation” is a somewhat fuzzy category that I have decided includes parentheses


rokitna
2020-12-5 06:23:21

How does the rectangle rule apply here? Don’t all four of these follow it already?


notjack
2020-12-5 07:05:31

yes, I forgot that the “prefer to break at the highest level of syntactic nesting” thing is separate from the rectangle rule