Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-09 Thread Philippe Mechaï
Just for the record, the bug seems to be known to someone :)
https://github.com/racket/gui/blob/master/gui-lib/framework/private/color.rkt#L989



On Mon, Oct 8, 2018 at 8:15 PM Robby Findler 
wrote:

> I like the idea that you suggested where the parens keep their paren
> color but the rest of the text becomes comment colored. It's not a
> trivial change, but it seems doable.
>
> Robby
>
> On Mon, Oct 8, 2018 at 12:37 PM Christopher Lemmer Webber
>  wrote:
> >
> > It sounds nice, but I wonder if it would be hard to shift consistently
> > in the right direction for both light and dark themes...
> >
> > I guess if the code's opacity was reduced that could be a universal
> > solution.
> >
> > Matthias Felleisen writes:
> >
> > > +1
> > >
> > >
> > >> On Oct 8, 2018, at 11:57 AM, Sam Tobin-Hochstadt <
> sa...@cs.indiana.edu> wrote:
> > >>
> > >> A suggestion: what if #; comments used the code coloring, but shifted
> > >> somewhat, or grayscaled, or something along those lines?
> > >>
> > >> Sam
> > >> On Mon, Oct 8, 2018 at 11:56 AM Matthias Felleisen
> > >>  wrote:
> > >>>
> > >>>
> >  On Oct 8, 2018, at 11:44 AM, Greg Hendershott <
> greghendersh...@gmail.com> wrote:
> > 
> >  p.s.
> > 
> >  On Mon, Oct 8, 2018 at 11:41 AM Greg Hendershott
> >   wrote:
> > > Another use case (that Mattias might not love) is somewhere for
> "usage
> > 
> >  Apologies for the typo, Matthias!
> > >>>
> > >>>
> > >>> No worries.
> > >>>
> > >>> And for the record, I also use #; for commenting out examples
> > >>> also when I work thru them. But I still feel code style is good
> > >>> for those.
> > >>>
> > >>> --
> > >>> 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.
> > >>> For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > 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.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-08 Thread Robby Findler
I like the idea that you suggested where the parens keep their paren
color but the rest of the text becomes comment colored. It's not a
trivial change, but it seems doable.

Robby

On Mon, Oct 8, 2018 at 12:37 PM Christopher Lemmer Webber
 wrote:
>
> It sounds nice, but I wonder if it would be hard to shift consistently
> in the right direction for both light and dark themes...
>
> I guess if the code's opacity was reduced that could be a universal
> solution.
>
> Matthias Felleisen writes:
>
> > +1
> >
> >
> >> On Oct 8, 2018, at 11:57 AM, Sam Tobin-Hochstadt  
> >> wrote:
> >>
> >> A suggestion: what if #; comments used the code coloring, but shifted
> >> somewhat, or grayscaled, or something along those lines?
> >>
> >> Sam
> >> On Mon, Oct 8, 2018 at 11:56 AM Matthias Felleisen
> >>  wrote:
> >>>
> >>>
>  On Oct 8, 2018, at 11:44 AM, Greg Hendershott 
>   wrote:
> 
>  p.s.
> 
>  On Mon, Oct 8, 2018 at 11:41 AM Greg Hendershott
>   wrote:
> > Another use case (that Mattias might not love) is somewhere for "usage
> 
>  Apologies for the typo, Matthias!
> >>>
> >>>
> >>> No worries.
> >>>
> >>> And for the record, I also use #; for commenting out examples
> >>> also when I work thru them. But I still feel code style is good
> >>> for those.
> >>>
> >>> --
> >>> 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.
> >>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-08 Thread Christopher Lemmer Webber
It sounds nice, but I wonder if it would be hard to shift consistently
in the right direction for both light and dark themes...

I guess if the code's opacity was reduced that could be a universal
solution.

Matthias Felleisen writes:

> +1
>
>
>> On Oct 8, 2018, at 11:57 AM, Sam Tobin-Hochstadt  
>> wrote:
>>
>> A suggestion: what if #; comments used the code coloring, but shifted
>> somewhat, or grayscaled, or something along those lines?
>>
>> Sam
>> On Mon, Oct 8, 2018 at 11:56 AM Matthias Felleisen
>>  wrote:
>>>
>>>
 On Oct 8, 2018, at 11:44 AM, Greg Hendershott  
 wrote:

 p.s.

 On Mon, Oct 8, 2018 at 11:41 AM Greg Hendershott
  wrote:
> Another use case (that Mattias might not love) is somewhere for "usage

 Apologies for the typo, Matthias!
>>>
>>>
>>> No worries.
>>>
>>> And for the record, I also use #; for commenting out examples
>>> also when I work thru them. But I still feel code style is good
>>> for those.
>>>
>>> --
>>> 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.
>>> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-08 Thread Matthias Felleisen


+1


> On Oct 8, 2018, at 11:57 AM, Sam Tobin-Hochstadt  wrote:
> 
> A suggestion: what if #; comments used the code coloring, but shifted
> somewhat, or grayscaled, or something along those lines?
> 
> Sam
> On Mon, Oct 8, 2018 at 11:56 AM Matthias Felleisen
>  wrote:
>> 
>> 
>>> On Oct 8, 2018, at 11:44 AM, Greg Hendershott  
>>> wrote:
>>> 
>>> p.s.
>>> 
>>> On Mon, Oct 8, 2018 at 11:41 AM Greg Hendershott
>>>  wrote:
 Another use case (that Mattias might not love) is somewhere for "usage
>>> 
>>> Apologies for the typo, Matthias!
>> 
>> 
>> No worries.
>> 
>> And for the record, I also use #; for commenting out examples
>> also when I work thru them. But I still feel code style is good
>> for those.
>> 
>> --
>> 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.
>> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-08 Thread Sam Tobin-Hochstadt
A suggestion: what if #; comments used the code coloring, but shifted
somewhat, or grayscaled, or something along those lines?

Sam
On Mon, Oct 8, 2018 at 11:56 AM Matthias Felleisen
 wrote:
>
>
> > On Oct 8, 2018, at 11:44 AM, Greg Hendershott  
> > wrote:
> >
> > p.s.
> >
> > On Mon, Oct 8, 2018 at 11:41 AM Greg Hendershott
> >  wrote:
> >> Another use case (that Mattias might not love) is somewhere for "usage
> >
> > Apologies for the typo, Matthias!
>
>
> No worries.
>
> And for the record, I also use #; for commenting out examples
> also when I work thru them. But I still feel code style is good
> for those.
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-08 Thread Matthias Felleisen


> On Oct 8, 2018, at 11:44 AM, Greg Hendershott  
> wrote:
> 
> p.s.
> 
> On Mon, Oct 8, 2018 at 11:41 AM Greg Hendershott
>  wrote:
>> Another use case (that Mattias might not love) is somewhere for "usage
> 
> Apologies for the typo, Matthias!


No worries. 

And for the record, I also use #; for commenting out examples 
also when I work thru them. But I still feel code style is good
for those. 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-08 Thread Greg Hendershott
p.s.

On Mon, Oct 8, 2018 at 11:41 AM Greg Hendershott
 wrote:
> Another use case (that Mattias might not love) is somewhere for "usage

Apologies for the typo, Matthias!

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-08 Thread Greg Hendershott
Sexpr comments are interesting because people want them to act mostly
like sexprs -- for indentation, and for structural editing/display
like paredit or rainbow-parens.

At most they should look like comments. Or not even that. As this
thread shows. :)


Another use case (that Mattias might not love) is somewhere for "usage
examples" to live during middle age.

- The usage examples are born when you casually type them into the REPL.

- They get copied to the file, so that, as you refine what they call,
they run to show the results you hopefully expect.

- Before graduation to some initial commit, people often sexpr-comment
them out. They can still be run via something like C-x C-e or C-M-x.

- Eventually, if the examples are good, ought they be moved to test,
srcdoc, and/or examples submodules?  Probably someday yes. But
retirement planning is hard work and people often postpone this. :)

TL;DR sexpr comments are sometimes used for things that TDD folks
might write up-front as formal tests.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-07 Thread Neil Van Dyke
FWIW, an unreleased Racket mode for Emacs (which did fast incremental 
lexing, and some higher parsing[1]) intentionally colored the entire 
expression after `#;` as a comment.  I don't recall whether I decided to 
have it skip over the commented expression for sibling-level sexp-based 
editor operations, like move-point-to-start-of-next-expression, though 
it probably did sexp operations and matching paren-highlighting while 
inside the commented expression.


I considered `#;` a convenience for quickly commenting out a sexp, since 
that's how I recall seeing it used.  Though sexp-aware editor commands 
can easily make quick sexp commenting and uncommenting easy using `;;`, 
including simple automatic unsnuggling and resnuggling of close-parens.


I didn't realize that some people wanted to treat `#;` as meaningful 
code-like sexp text that's not actually code.  (For pedagogic purposes, 
I suppose it makes sense to be clear that not all code-level-ish 
abstractions in the process are code, so maybe you use a 
comment in a beginner `#lang` for that, even if you want to use a sexp 
too.  But, for later purposes, maybe you actually want that particular 
sexp thing to be code in a syntax extension or `#lang`.  Then you get 
Contracts, Typed Racket, or embedded API docs, or embedded 
specification, or something else.)


Incidentally, a pertinent bit of the Emacs mode tests (below) makes 
framework-restricted coders cry (in that case, the framework was based 
on regexps, legacy kludgey character syntax classes, and a few fixed 
concepts of syntax).  But those tears turn into ones of joy, when the 
coder remembers that they are actually a CS-educated software engineer, 
who can make a technical assessment and business case that the framework 
is a barrier to smash, and roll up their sleeves, for some some good 
old-fashioned automata theory, algorithm design, and efficient programming.


  (insert "(define (f x #:y (y 0) #:z (z 0))\n")
  (insert "  (xxx '''(yyy (\"(\"\n")
  (insert "    ;; (\n")
  (insert "    (zzz #\\( ppp)\n")
  (insert "    #| #| ( |# ( |#\n")
  (insert "    qqq)\n")
  (insert "    #;#;(1\n")
  (insert " 2)\n")
  (insert "  (3 '(4 5) 6)\n")
  (insert "    (n)\n")
  (insert "   rrr)\n")
  (insert "   #;)\n")
  (insert "   sss))\n")

[1] It got mothballed when my book was, the pre-Git SCM repo was lost, 
the only known survivor of the main file was in a checkout workspace, in 
middle of an architecture change, and I don't have free person-days to 
reconstruct the prior/next version.  Meow was a big advance beyond Quack 
(the original poor substitute for DrScheme), but it didn't do the great 
things Greg's `racket-mode` now does, anyway.


--
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-07 Thread Christopher Lemmer Webber
Daniel Prager writes:

> If only there was a way to have the best of both worlds.
>
> E.g. change the background color for #; to something reminiscent of the
> foreground color of regular comments:
>
> (display #|Comment|#
>  ; comment
>  #;(string-join "comm" "ent")
>  "Hello world")
>
> Or perhaps something like the emacs rainbow-parens that Christopher
> mentioned could help.
>
> Dan

Yeah, and to be clear, no rainbows required: just make the text
comment-colored and the parentheses normal-delimeter-color, for whatever
that happens to be in your editor.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-07 Thread Daniel Prager
If only there was a way to have the best of both worlds.

E.g. change the background color for #; to something reminiscent of the
foreground color of regular comments:

(display #|Comment|#
 ; comment
 #;(string-join "comm" "ent")
 "Hello world")

Or perhaps something like the emacs rainbow-parens that Christopher
mentioned could help.

Dan


On Mon, Oct 8, 2018 at 4:43 AM Matthias Felleisen 
wrote:

>
> I have some sympathy for this view but I think that it is a
> misunderstanding.
>
> I think #; is rather distinct from #| ... |# and ;;  It signals “the
> following is a
> code snippet that is currently not useful or not quite right but you
> should
> read it as code and with the structure of code in mind”.  Here is a use
> that
> illustrates this. When I write untyped code, I strictly follow the design
> recipe
> (because I discovered that “do as I tell you not as I do” applies here
> too).
> For signatures, I write
>
>  #; [ String String -> (U Number String) ]
>  (define (f s t)
>(if (= (string-length t) 3) 0 s))
>
> and such things. I want this signature to be readable as code when someone
> wishes to inject types into my code.
>
> Similar uses for code snippets abound in my repos too. — Matthias
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-07 Thread Matthias Felleisen


>> I find the #; construct very convenient for commenting out sexps, but in Dr
>> Racket the visual cue of switching to comment-color is missing.
>> 
>> Example (in Racket 6.12):
>> 
>> [image: Screen Shot 2018-10-07 at 10.19.09 pm.png]
>> 
>> Expected:
>> 
>> *#lang racket*
>> 
>> (display #|Comment|#
>> ; comment
>> #;(string-join "comm" "ent")
>> "Hello world")



I have some sympathy for this view but I think that it is a misunderstanding. 

I think #; is rather distinct from #| ... |# and ;;  It signals “the following 
is a 
code snippet that is currently not useful or not quite right but you should 
read it as code and with the structure of code in mind”.  Here is a use that 
illustrates this. When I write untyped code, I strictly follow the design 
recipe 
(because I discovered that “do as I tell you not as I do” applies here too). 
For signatures, I write 

 #; [ String String -> (U Number String) ]
 (define (f s t)
   (if (= (string-length t) 3) 0 s))

and such things. I want this signature to be readable as code when someone
wishes to inject types into my code. 

Similar uses for code snippets abound in my repos too. — Matthias

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-07 Thread Matthias Felleisen


For quite some time, I have 



> On Oct 7, 2018, at 8:05 AM, Christopher Lemmer Webber 
>  wrote:
> 
> I agree that they should be shown as comments.
> 
> In many ways I like what happens (probably unintentionally) in my emacs
> setup: I have rainbow-delimeters enabled, which colors the parentheses.
> When I comment out the s-exp with #; the sexp looks commented out, but
> the parentheses remain colored.  While an accident, that may be the
> optimal behavior: it shows that it's commented out, but indicates
> something about the sexp grouping being *structurally* commented out,
> as opposed to a line or block comment.
> 
> But barring that, they should just render as comments :)
> 
> Daniel Prager writes:
> 
>> I find the #; construct very convenient for commenting out sexps, but in Dr
>> Racket the visual cue of switching to comment-color is missing.
>> 
>> Example (in Racket 6.12):
>> 
>> [image: Screen Shot 2018-10-07 at 10.19.09 pm.png]
>> 
>> Expected:
>> 
>> *#lang racket*
>> 
>> (display #|Comment|#
>> ; comment
>> #;(string-join "comm" "ent")
>> "Hello world")
>> 
>> 
>> Dan
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-07 Thread Christopher Lemmer Webber
I agree that they should be shown as comments.

In many ways I like what happens (probably unintentionally) in my emacs
setup: I have rainbow-delimeters enabled, which colors the parentheses.
When I comment out the s-exp with #; the sexp looks commented out, but
the parentheses remain colored.  While an accident, that may be the
optimal behavior: it shows that it's commented out, but indicates
something about the sexp grouping being *structurally* commented out,
as opposed to a line or block comment.

But barring that, they should just render as comments :)

Daniel Prager writes:

> I find the #; construct very convenient for commenting out sexps, but in Dr
> Racket the visual cue of switching to comment-color is missing.
>
> Example (in Racket 6.12):
>
> [image: Screen Shot 2018-10-07 at 10.19.09 pm.png]
>
> Expected:
>
> *#lang racket*
>
> (display #|Comment|#
>  ; comment
>  #;(string-join "comm" "ent")
>  "Hello world")
>
>
> Dan

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Should #; comments be colored as comments or code in Dr Racket?

2018-10-07 Thread Daniel Prager
I find the #; construct very convenient for commenting out sexps, but in Dr
Racket the visual cue of switching to comment-color is missing.

Example (in Racket 6.12):

[image: Screen Shot 2018-10-07 at 10.19.09 pm.png]

Expected:

*#lang racket*

(display #|Comment|#
 ; comment
 #;(string-join "comm" "ent")
 "Hello world")


Dan

-- 
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.
For more options, visit https://groups.google.com/d/optout.