Re: [racket-users] Re: [ANN] fmt: a Racket code formatter

2021-10-19 Thread Hendrik Boom
On Tue, Oct 19, 2021 at 11:07:58AM -0700, Sorawee Porncharoenwase wrote:
> On Tue, Oct 19, 2021 at 7:01 AM Diego Crespo
> mycontributiontothewo...@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 body
>- syntax-case, syntax-rules body
>- syntax-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 bindings
>- and a few more
> 
> What happened earlier was that class was erroneously configured to have
> this paren shape conversion, even though it should not.

I find the layout of the second version more readable,
but find the choice of parenthesis shape in the first version more readable.

-- hendrik

> 
> 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.)
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CADcuegs%2BepCLAXHzjXxPdq%3DR6su0heHOJRBYgWL7_tLj5J%3Db2A%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20211020014753.yl36iozz5wzpcyzb%40topoi.pooq.com.


Re: [racket-users] Re: [ANN] fmt: a Racket code formatter

2021-10-19 Thread Sorawee Porncharoenwase
On Tue, Oct 19, 2021 at 7:01 AM Diego Crespo
mycontributiontothewo...@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 body
   - syntax-case, syntax-rules body
   - syntax-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 bindings
   - and a few more

What 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.)

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegs%2BepCLAXHzjXxPdq%3DR6su0heHOJRBYgWL7_tLj5J%3Db2A%40mail.gmail.com.


Re: [racket-users] Re: [ANN] fmt: a Racket code formatter

2021-10-19 Thread Diego Crespo
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 :)) 

On Tuesday, October 19, 2021 at 9:34:04 AM UTC-4 hen...@topoi.pooq.com 
wrote:

> When I read this:
>
> > On Mon, Oct 18, 2021 at 6:14 PM Diego Crespo <
> > mycontributi...@gmail.com> wrote:
> > 
> > > This is really cool. Between this, a Racket linter, and an LSP, Racket 
> is
> > > seriously looking a lot better for larger teams. I ran it through some 
> of
> > > my code and I'm curious about the decision to use brackets more 
> liberally.
> > > I was surprised when it changed my methods in my classes to be 
> bracketed,
> > > as well as the init, and field expressions. I could probably get used 
> to it
> > > given enough time, but I haven't seen that style in other Racket code
> > > before.
>
> I thought, great! This will ameilorate the perennial parenthesis problem 
> by using 
> different kinds of brackets for different uses.
>
> THen I read this:
>
> On Mon, Oct 18, 2021 at 07:06:41PM -0700, Sorawee Porncharoenwase wrote:
> > Don't get used to it. It's a bug!
> > 
> > Fixed in
> > 
> https://github.com/sorawee/fmt/commit/e056aee1e9a3ea0a72a4c85075426fa76f037852
> .
> > Thanks for the report!
>
> and was disappointed.
>
> The I started wondering -- just what did it look like, that the use of 
> different 
> brackets would be considered a problem?
>
> -- hendrik
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/f9b2611c-105b-4594-acb7-1af1a2992d3en%40googlegroups.com.


Re: [racket-users] Re: [ANN] fmt: a Racket code formatter

2021-10-19 Thread Hendrik Boom
When I read this:

> On Mon, Oct 18, 2021 at 6:14 PM Diego Crespo <
> mycontributiontothewo...@gmail.com> wrote:
> 
> > This is really cool. Between this, a Racket linter, and an LSP, Racket is
> > seriously looking a lot better for larger teams. I ran it through some of
> > my code and I'm curious about the decision to use brackets more liberally.
> > I was surprised when it changed my methods in my classes to be bracketed,
> > as well as the init, and field expressions. I could probably get used to it
> > given enough time, but I haven't seen that style in other Racket code
> > before.

I thought, great!  This will ameilorate the perennial parenthesis problem by 
using 
different kinds of brackets for different uses.

THen I read this:

On Mon, Oct 18, 2021 at 07:06:41PM -0700, Sorawee Porncharoenwase wrote:
> Don't get used to it. It's a bug!
> 
> Fixed in
> https://github.com/sorawee/fmt/commit/e056aee1e9a3ea0a72a4c85075426fa76f037852.
> Thanks for the report!

and was disappointed.

The I started wondering -- just what did it look like, that the use of 
different 
brackets would be considered a problem?

-- hendrik

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20211019133356.257w6kempwu57api%40topoi.pooq.com.


Re: [racket-users] Re: [ANN] fmt: a Racket code formatter

2021-10-18 Thread Sorawee Porncharoenwase
Don't get used to it. It's a bug!

Fixed in
https://github.com/sorawee/fmt/commit/e056aee1e9a3ea0a72a4c85075426fa76f037852.
Thanks for the report!

On Mon, Oct 18, 2021 at 6:14 PM Diego Crespo <
mycontributiontothewo...@gmail.com> wrote:

> This is really cool. Between this, a Racket linter, and an LSP, Racket is
> seriously looking a lot better for larger teams. I ran it through some of
> my code and I'm curious about the decision to use brackets more liberally.
> I was surprised when it changed my methods in my classes to be bracketed,
> as well as the init, and field expressions. I could probably get used to it
> given enough time, but I haven't seen that style in other Racket code
> before.
>
>
> On Tuesday, September 28, 2021 at 2:03:28 PM UTC-4 sorawe...@gmail.com
> wrote:
>
>> 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.
>>
>>- Source: https://github.com/sorawee/fmt/
>>- Documentation and demo: https://docs.racket-lang.org/fmt/
>>
>> 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.
>>
>>- Source: https://github.com/sorawee/pprint-compact/
>>- Documentation and demo: https://docs.racket-lang.org/pprint-compact/
>>
>> 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+unsubscr...@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
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegv%2B3xL8un9fNr%2BKeT7%3D44s%2BoMuFfH6uemyw2q5JiU9cOg%40mail.gmail.com.


[racket-users] Re: [ANN] fmt: a Racket code formatter

2021-10-18 Thread Diego Crespo
This is really cool. Between this, a Racket linter, and an LSP, Racket is 
seriously looking a lot better for larger teams. I ran it through some of 
my code and I'm curious about the decision to use brackets more liberally. 
I was surprised when it changed my methods in my classes to be bracketed, 
as well as the init, and field expressions. I could probably get used to it 
given enough time, but I haven't seen that style in other Racket code 
before.


On Tuesday, September 28, 2021 at 2:03:28 PM UTC-4 sorawe...@gmail.com 
wrote:

> 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.
>
>- Source: https://github.com/sorawee/fmt/ 
>- Documentation and demo: https://docs.racket-lang.org/fmt/ 
>
> 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.
>
>- Source: https://github.com/sorawee/pprint-compact/ 
>- Documentation and demo: https://docs.racket-lang.org/pprint-compact/ 
>
> 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+unsubscr...@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.


[racket-users] Re: [ANN] fmt: a Racket code formatter

2021-10-18 Thread Diego Crespo
This is really cool. Between this, a Racket linter, and an LSP, Racket is 
seriously looking a lot better for larger teams. I ran it through some of 
my code and I'm curious about the decision to use brackets more liberally. 
I was surprised when it changed my methods in my classes to be bracketed, 
as well as the init, and field expressions. I could probably get used to it 
given enough time, but I haven't seen that style in other Racket code 
before.



On Tuesday, September 28, 2021 at 2:03:28 PM UTC-4 sorawe...@gmail.com 
wrote:

> 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.
>
>- Source: https://github.com/sorawee/fmt/ 
>- Documentation and demo: https://docs.racket-lang.org/fmt/ 
>
> 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.
>
>- Source: https://github.com/sorawee/pprint-compact/ 
>- Documentation and demo: https://docs.racket-lang.org/pprint-compact/ 
>
> 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/a30f697a-36a0-40cf-b6d9-4c8c9356af3cn%40googlegroups.com.