Re: [racket-users] printing errors

2020-08-27 Thread Robby Findler
It may be that you're seeing the "clever"ness of the DrRacket repl. If the
last character printed is a newline, it only shows it when there is another
character after the newline.

Robby

On Thu, Aug 27, 2020 at 5:18 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> For stacktrace, use error-print-context-length to suppress it:
>
> (define (print-exn exn)
>   (parameterize ([error-print-context-length 0])
> ((error-display-handler)
>  (if (exn? exn)
>  (exn-message exn)
>  (format "~a" exn))
>  exn)))
>
> I don’t see any extra newline though.
>
> On Thu, Aug 27, 2020 at 3:11 PM Shriram Krishnamurthi 
> wrote:
>
>> This is perfect, thanks!
>>
>> Two follow-up questions:
>>
>> 1. The error printer seems to print an extra newline at the end relative
>> to what the port-display-handler (for instance) shows. Is there a way to
>> suppress that?
>>
>> 2. The stack trace seems to be extracted automatically. Is there a way to
>> suppress it entirely?
>>
>> Shriram
>>
>> --
>> 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/CAJUf2yQyVat2Fy63hdDqRv9iaq40Zsf_6TQJsLU%3DETB30zCE0Q%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/CADcuegsxbKF6CZi01J0mduxo9vS5U2QDjn5M-jA12h21NB02PA%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/CAL3TdONWoR-hLAudmCwAkcCoUzHG98kX47yHcsqnH%2B0nS9jViA%40mail.gmail.com.


Re: [racket-users] printing errors

2020-08-27 Thread Sorawee Porncharoenwase
For stacktrace, use error-print-context-length to suppress it:

(define (print-exn exn)
  (parameterize ([error-print-context-length 0])
((error-display-handler)
 (if (exn? exn)
 (exn-message exn)
 (format "~a" exn))
 exn)))

I don’t see any extra newline though.

On Thu, Aug 27, 2020 at 3:11 PM Shriram Krishnamurthi 
wrote:

> This is perfect, thanks!
>
> Two follow-up questions:
>
> 1. The error printer seems to print an extra newline at the end relative
> to what the port-display-handler (for instance) shows. Is there a way to
> suppress that?
>
> 2. The stack trace seems to be extracted automatically. Is there a way to
> suppress it entirely?
>
> Shriram
>
> --
> 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/CAJUf2yQyVat2Fy63hdDqRv9iaq40Zsf_6TQJsLU%3DETB30zCE0Q%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/CADcuegsxbKF6CZi01J0mduxo9vS5U2QDjn5M-jA12h21NB02PA%40mail.gmail.com.


Re: [racket-users] printing errors

2020-08-27 Thread Shriram Krishnamurthi
This is perfect, thanks!

Two follow-up questions:

1. The error printer seems to print an extra newline at the end relative to
what the port-display-handler (for instance) shows. Is there a way to
suppress that?

2. The stack trace seems to be extracted automatically. Is there a way to
suppress it entirely?

Shriram

-- 
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/CAJUf2yQyVat2Fy63hdDqRv9iaq40Zsf_6TQJsLU%3DETB30zCE0Q%40mail.gmail.com.


Re: [racket-users] printing errors

2020-08-27 Thread Robby Findler
Yes, something like this:

(define (print-exn exn)
((error-display-handler)
 (if (exn? exn)
 (exn-message exn)
 (format "~a" exn))
 exn))

On Thu, Aug 27, 2020 at 3:31 PM Shriram Krishnamurthi 
wrote:

> Given an exception, is there a way to print the error using Racket's
> conventional error printing machinery (e.g., in color in DrRacket, etc.),
> without halting execution?
>
> I would like to be able to integrate this with #%printing-module-begin and
> #%top-interaction. Unfortunately, those by default will halt execution
> after printing the message.
>
> --
> 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/a6277017-9dc8-44d1-8c97-119cb431cf4bn%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/CAL3TdONeeLAF38_cSPk12JT4W3T4Gruh5ET4tHYDrS_-zHHJ4g%40mail.gmail.com.


[racket-users] printing errors

2020-08-27 Thread Shriram Krishnamurthi
Given an exception, is there a way to print the error using Racket's 
conventional error printing machinery (e.g., in color in DrRacket, etc.), 
without halting execution?

I would like to be able to integrate this with #%printing-module-begin and 
#%top-interaction. Unfortunately, those by default will halt execution 
after printing the message.

-- 
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/a6277017-9dc8-44d1-8c97-119cb431cf4bn%40googlegroups.com.


Re: [racket-users] Re: new racket-lang.org website

2020-08-27 Thread gtrz...@gmail.com
Looks OK now - I would leave it at that - no need to complicate things 
further!

On Thursday, August 27, 2020 at 3:50:44 PM UTC+2 Robby Findler wrote:

> I made an attempt at solution 2 (the font seemed to be already pretty 
> small just before 650px) and I've updated things here: 
> https://users.cs.northwestern.edu/~robby/tmp/Web/www/
>
> Is that better? What do you think?
>
> Robby
>
>
> On Thu, Aug 27, 2020 at 7:53 AM gtrz...@gmail.com  
> wrote:
>
>> The only problem I see is between 550 - 650 px width of the screen, the 
>> tab menu labels are squashed  (as in Dominik's screenshot)  and the code 
>> samples in 'Racket, the Language-Oriented Programming Language' are outside 
>> the width of the headers . 
>> Solutions:
>> 1. Keep the tabs (although with smaller fonts) but change content 
>> flex-direction to row for this range
>> or
>> 2. Have just one cut off - 650px for mobile/tablet
>>
>> On Tuesday, August 25, 2020 at 7:51:57 PM UTC+2 Robby Findler wrote:
>>
>>> Hi all: as you may know if you follow dev@, we've been revising the 
>>> website. The new version went live last night; please have a look: 
>>> https://www.racket-lang.org/
>>>
>>> A big Thank You to Matthew Butterick for the previous design which, as 
>>> you can tell, inspired the current visual design.
>>>
>>> Matthew, Robby, Sam, Jay, John, and 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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/e9346cb6-a68d-4f49-9c0c-61165e1881e3n%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/f7181928-492c-4abc-982c-2e855e121bb3n%40googlegroups.com.


Re: [racket-users] Re: new racket-lang.org website

2020-08-27 Thread Robby Findler
I made an attempt at solution 2 (the font seemed to be already pretty small
just before 650px) and I've updated things here:
https://users.cs.northwestern.edu/~robby/tmp/Web/www/

Is that better? What do you think?

Robby


On Thu, Aug 27, 2020 at 7:53 AM gtrz...@gmail.com 
wrote:

> The only problem I see is between 550 - 650 px width of the screen, the
> tab menu labels are squashed  (as in Dominik's screenshot)  and the code
> samples in 'Racket, the Language-Oriented Programming Language' are outside
> the width of the headers .
> Solutions:
> 1. Keep the tabs (although with smaller fonts) but change content
> flex-direction to row for this range
> or
> 2. Have just one cut off - 650px for mobile/tablet
>
> On Tuesday, August 25, 2020 at 7:51:57 PM UTC+2 Robby Findler wrote:
>
>> Hi all: as you may know if you follow dev@, we've been revising the
>> website. The new version went live last night; please have a look:
>> https://www.racket-lang.org/
>>
>> A big Thank You to Matthew Butterick for the previous design which, as
>> you can tell, inspired the current visual design.
>>
>> Matthew, Robby, Sam, Jay, John, and 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/e9346cb6-a68d-4f49-9c0c-61165e1881e3n%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/CAL3TdOOkv%3DQw89PpqmUn_SbTEv5Ygca%3De8z0TcDZBWbP3j-SVg%40mail.gmail.com.


[racket-users] Re: new racket-lang.org website

2020-08-27 Thread gtrz...@gmail.com
The only problem I see is between 550 - 650 px width of the screen, the tab 
menu labels are squashed  (as in Dominik's screenshot)  and the code 
samples in 'Racket, the Language-Oriented Programming Language' are outside 
the width of the headers . 
Solutions:
1. Keep the tabs (although with smaller fonts) but change content 
flex-direction to row for this range
or
2. Have just one cut off - 650px for mobile/tablet

On Tuesday, August 25, 2020 at 7:51:57 PM UTC+2 Robby Findler wrote:

> Hi all: as you may know if you follow dev@, we've been revising the 
> website. The new version went live last night; please have a look: 
> https://www.racket-lang.org/
>
> A big Thank You to Matthew Butterick for the previous design which, as you 
> can tell, inspired the current visual design.
>
> Matthew, Robby, Sam, Jay, John, and 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/e9346cb6-a68d-4f49-9c0c-61165e1881e3n%40googlegroups.com.