Announcing the pre-alpha version of fmt
, a Racket code formatter. Code formatter is a tool that reformats your code so that it conforms to a style consistently.
As a part of this work, I implemented Jean-Philippe Bernady’s non greedy pretty printer (ICFP’17) and extended it so that it is practical for actual use.
Hope you find these useful, and let me know if you have any feedback.
Sorawee (Oak)
--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CADcueguOiOBK4vE3kCfvWYkb2Eaz-JfM5_Yd%3DGct-6umSUEG6w%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/3fc35f69-9e3f-4bc0-82cf-c31baeebc21an%40googlegroups.com.
On Tue, Oct 19, 2021 at 7:01 AM Diego Crespo mycontributi...@gmail.com wrote:
If you are curious about what the output looked like before, here is the pasterack link of some of my code http://pasterack.org/pastes/23639. Racket supports using brackets instead of parenthesis, but you typically only see it used in things like cond and let expressions. This was adding them to far more expressions. Other than looking odd, there was nothing wrong with the code (other than my own errors :))
FWIW, here’s what the tool would output now (provided that the input code’s paren shapes are not yet compromised): http://pasterack.org/pastes/21352
raco fmt
will usually keep paren shape intact, but it can convert paren shape in some positions. Right now, the only conversion is from parenthesis to bracket, and it’s enabled for:
cond
, case-lambda
, match
, case
bodysyntax-case
, syntax-rules
bodysyntax-parse
(including syntax-parser
and define-syntax-parser
) body.for
bindings (including for/...
and for*/...
)let
bindings (including letrec
, let-syntax
, let-values
, …)parameterize
, with-syntax
, shared
bindingsWhat happened earlier was that class
was erroneously configured to have this paren shape conversion, even though it should not.
On Tuesday, October 19, 2021 at 9:34:04 AM UTC-4 hen...@topoi.pooq.com wrote:
and was disappointed.
I would not recommend this, but if you strongly feel that the class
body should use brackets, you are free to write your own formatting rules.
(Though I have not documented how to do so.)
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/20211020014753.yl36iozz5wzpcyzb%40topoi.pooq.com.