Re: [racket-users] [racket users] raise-user-error question

2020-09-19 Thread Robby Findler
That's some internal error "uh oh, something's wrong ... print out some
hints to help people debug!" message.

It looks like that's been fixed since, however as I don't see it in git
build.

Robby


On Sat, Sep 19, 2020 at 5:31 PM Kevin Forchione  wrote:

> Hi guys.
>
> Using Racket 7.8 [cs[, If I create a module called error.rkt with the
> following code
> #lang racket
>
> (provide foo)
> (define foo (λ () (raise-user-error "foo")))
>
> And then a module called error-test.rket with the following code
> #lang racket
>
> (require "error.rkt")
>
> (foo)
>
> And execute error-r-test.rkt I get the following
>
> Welcome to DrRacket, version 7.8 [cs].
> Language: racket, with debugging; memory limit: 1024 MB.
> -- #(struct:exn:fail:contract "vector-ref: contract violation\n  expected:
> vector?\n  given: '((raise-user-error \"foo\")
> # Documents/com~apple~CloudDocs/Racket/utils/conspiracy/error.rkt> 4 18 47
> 24)" #)
>   ("condition->exn" . #f)
>   ("do-raise" . #f)
>   ("dynamic-wind" . #f)
>   ("errortrace-stack-item->srcloc" . #(struct:srcloc
> # 168 0 6297 203))
>   ("pick-first-defs" . #(struct:srcloc
> # 331 0 13000 425))
>   ("get-exn-source-locs" . #(struct:srcloc
> # 585 0 23184 391))
>   (#f . #(struct:srcloc # 486 18
> 20735 32))
>   ("error-display-handler/stacktrace" . #(struct:srcloc
> # 362 2 15076 2612))
>   ("debug-error-display-handler" . #(struct:srcloc
> # 341 4 14358 566))
>   ("default-uncaught-exception-handler" . #f)
>   ("loop" . #f)
>   ("call-in-empty-metacontinuation-frame" . #f)
>   ("call-with-values" . #f)
>   ("call-in-empty-metacontinuation-frame" . #f)
>   (|body of "/Users/lysseus/Library/Mobile
> Documents/com~apple~CloudDocs/Racket/utils/conspiracy/error-test.rkt"| . #f)
>   ("temp35_0" . #f)
>   ("run-module-instance!" . #f)
>   ("perform-require!" . #f)
>   (#f . #(struct:srcloc # 115 30
> 4709 11))
>   ("call-with-stack-checkpoint" . #(struct:srcloc
> # 82 0 3329 442))
>   ("call-in-empty-metacontinuation-frame" . #f)
>   ("*init" . #(struct:srcloc # 463 8
> 22165 762))
>   ("call-with-break-parameterization" . #(struct:srcloc
> # 148 2 4909 517))
>   ("call-in-empty-metacontinuation-frame" . #f)
>   (#f . #(struct:srcloc # 1180 9 49153 5062))
>   (#f . #(struct:srcloc # 1493 15 64385 1548))
>   (#f . #(struct:srcloc # 435 6 19067 1056))
>   ("call-in-empty-metacontinuation-frame" . #f)
>   ("call-in-empty-metacontinuation-frame" . #f)
>   (#f . #(struct:srcloc # 486 32 21054 120))
>   ("call-with-break-parameterization" . #(struct:srcloc
> # 148 2 4909 517))
>   ("call-in-empty-metacontinuation-frame" . #f)
>   ("eventspace-handler-thread-proc" . #(struct:srcloc
> # 370 11 16515 690))
>   ("call-in-empty-metacontinuation-frame" . #f)
>   ("call-with-empty-metacontinuation-frame-for-swap" . #f)
> exception raised by error display handler: vector-ref: contract violation
>   expected: vector?
>   given: '((raise-user-error "foo") # Documents/com~apple~CloudDocs/Racket/utils/conspiracy/error.rkt> 4 18 47
> 24); original exception raised: foo
>   context...:
>loop
>dynamic-wind
>.../private/stack-checkpoint.rkt:168:0: errortrace-stack-item->srcloc
>.../private/stack-checkpoint.rkt:331:0: pick-first-defs
>.../private/stack-checkpoint.rkt:585:0: get-exn-source-locs
>.../private/arrow-val-first.rkt:486:18
>.../private/debug.rkt:362:2: error-display-handler/stacktrace
>.../private/debug.rkt:341:4: debug-error-display-handler
>default-uncaught-exception-handler
>loop
>call-in-empty-metacontinuation-frame
>call-with-values
>call-in-empty-metacontinuation-frame
>body of "/Users/lysseus/Library/Mobile
> Documents/com~apple~CloudDocs/Racket/utils/conspiracy/error-test.rkt"
>temp35_0
>run-module-instance!
> >
>
> Is this what I should expect?
>
> Kevin
>
> --
> 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/F848340C-7BBC-4C13-A94F-723AB4B941DA%40gmail.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/CAL3Td%2BE3s7MSVSPzD1ZxT-LsHZcLpuycVe3ztch0MAgF6g%40mail.gmail.com.


Re: [racket-users] Scribbling hexadecimal values

2020-09-19 Thread Robby Findler
I don't have any good hints but the reader supplies span information that
can be used to disambiguate the original versions of some things (notably
"#t" vs "#true"). I doubt this is enough for numbers in any general sense
but following the path of actually carrying more information from the
reader through scribble to the rendered output may be an approach worth
considering.

Robby

On Sat, Sep 19, 2020 at 2:29 AM Dominik Pantůček <
dominik.pantu...@trustica.cz> wrote:

> Hi Eric,
>
> thank you. Actually I was already using unsyntax for putting the default
> values in optional arguments list and didn't recognize that I can use
> anything from the scribble API at that point. Now the formatting of
> default values is simple and yields expected results. In my case:
>
> (()
>((argb #,(racketvalfont (format "#x~x" (arithmetic-shift alpha-max
> 24))
>
> This is really cool.
>
> However, for the contract part, I think the only solution would be
> adding a parameter that would change the behavior of
> proc-doc-transformer and proc-doc/names transformer or more generally
> add support to *defproc's do-one' arg-contracts handling code.
>
> This basically goes down to racketblock0 rendering of numbers.
>
> I am afraid that this needs some with more experience with scribble
> internals to implement. I think that adding parameter to configure the
> rendering of numbers inside define-code-like forms will be rather easy.
> But how to parameterize in provide block and not mess with any of those
> proc-doc*transformer code is currently beyond my understanding.
>
> I would appreciate any hints though.
>
>
> Cheers,
> Dominik
>
> On 19. 09. 20 3:40, Eric Griffis wrote:
> > Hi Dominik,
> >
> > If you put the hex number in a string, many of the formatting functions
> > in the Scribble manual, section 4.2.1.4 will work:
> >
> >   (proc-doc/names
> >name
> >(->* () (integer?) void?)
> >(()
> > ((argument #,(racketvalfont "#x1f"
> >@{ some description }))
> >
> > Eric
> >
> >
> > On Fri, Sep 18, 2020 at 2:23 PM Dominik Pantůček
> > mailto:dominik.pantu...@trustica.cz>>
> wrote:
> >
> > Hello Racketeers,
> >
> > I am struggling to make scribble typeset default values in
> > proc-doc/names in hexadecimal. An example would be:
> >
> > (proc-doc/names
> >   name
> >   (->* () (integer?) void?)
> >   (()
> >((argument #x1f)))
> >   @{ some description }) ; yes, at-exp reader
> >
> > The same applies to values in nested contracts of ->* - like
> (integer-in
> > 0 #x1f).
> >
> > Of course #,(~a "~x" #x1f) will produce the string with appropriate
> > contents - but enclosed in parentheses which does not help much.
> Also it
> > is not just a matter of typesetting because the provide form really
> > contracts the procedure being provided and the actual values should
> > actually be present.
> >
> > I would love to see some documentation-stage parameter where I could
> > just (parameterize ((numbers-as-hexadecimal #t)) (integer-in ...)
> ...)
> > and it would keep the values as they are for contract purposes and
> > render them hexadecimal. Of course, this is quite specific - more
> > generic solution is probably more appropriate, this is just to
> explain
> > the problem I am trying to solve.
> >
> >
> > Cheers,
> > Dominik
> >
> > --
> > 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/aca5b2ab-36b6-98c6-0747-9d5447ae9766%40trustica.cz
> .
> >
>
> --
> 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/23557632-fe68-567e-3a2e-c9abf6df5779%40trustica.cz
> .
>

-- 
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/CAL3TdONQ0qhD-CMijbX9F_CXqziCqNuTSMhwBMc7M6dUqgWqRg%40mail.gmail.com.


Re: [racket-users] UTF-8 encoding error when opening files in DrRacket on Windows 10

2020-09-17 Thread Robby Findler
I know only that we didn't get the report with earlier versions.

BTW, if one click on the dialog that has the error message, there should be
a "copy" option that will let you get some potentially valuable debugging
information. If it is easy to get a student who is having the problem to do
that, it may be helpful to report it back.

Robby


On Thu, Sep 17, 2020 at 8:46 AM breanndan@gmail.com <
breanndan.o.nuall...@gmail.com> wrote:

> Thanks Robby. We'll experiment with that.
>
> Any  idea if it's just the current version fo DrRacket? We could have them
> try installing the previous version for the time being.
>
> On Thursday, 17 September 2020 at 14:45:06 UTC+2 Robby Findler wrote:
>
>> We have had one other report yes. It looks like something is going wrong
>> with the open file dialog. It may be possible to open files by double
>> clicking on them to sidestep the bug I am not sure.
>>
>> Sorry about this.
>>
>> Robby
>>
>> On Thu, Sep 17, 2020 at 6:29 AM breanndan@gmail.com <
>> breanndan@gmail.com> wrote:
>>
>>> I have two students who just installed DrRacket on Windows 10 and get
>>> this error when they try to open files:
>>>
>>> bytes->string/locale: string is not a well-formed UTF-8 encoding
>>> string: #"\340lU\1"
>>>
>>> Has anyone else encountered this?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>> 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/cef31834-11d8-4bc3-b03d-c63d2868f097n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/racket-users/cef31834-11d8-4bc3-b03d-c63d2868f097n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>>
>>> --
> 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/9b1a259b-1aa0-4b7c-b902-78376ccc9253n%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/9b1a259b-1aa0-4b7c-b902-78376ccc9253n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: [racket-users] UTF-8 encoding error when opening files in DrRacket on Windows 10

2020-09-17 Thread Robby Findler
We have had one other report yes. It looks like something is going wrong
with the open file dialog. It may be possible to open files by double
clicking on them to sidestep the bug I am not sure.

Sorry about this.

Robby

On Thu, Sep 17, 2020 at 6:29 AM breanndan@gmail.com <
breanndan.o.nuall...@gmail.com> wrote:

> I have two students who just installed DrRacket on Windows 10 and get this
> error when they try to open files:
>
> bytes->string/locale: string is not a well-formed UTF-8 encoding
> string: #"\340lU\1"
>
> Has anyone else encountered this?
>
>
>
>
>
>
>
>
> --
>
>
> 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/cef31834-11d8-4bc3-b03d-c63d2868f097n%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/CAL3TdOPjFL0h5xcO_b%3DcE0vgD3yEw4O8YhbP-9ktoRHDpwzU6Q%40mail.gmail.com.


Re: [racket-users] package manager woes on Windows 10?

2020-09-15 Thread Robby Findler
The change I made is in the gui-pkg-manager repo (well there may be one
more word in the name).

Yes, it does just strip. I didn't see any code that was doing what you
describe but I also didn't look for it!

Robby

On Tue, Sep 15, 2020 at 8:39 AM John Clements 
wrote:

> I have a question about the new behavior.
>
>
>
> (ObResearch: actually, I checked the drracket, racket, and gui repos, and
> I couldn’t find any new push, so I couldn’t check the code myself.)
>
>
>
> Does it simply strip newlines, as Jack suggested, or does it signal an
> error? The latter seems less likely to silently cause weird problems /
> vulnerabilities / etc.
>
>
>
> Also, I notice that the (current) behavior changes when there’s a branch
> specified explicitly; it seems that in this case, the URL parser happily
> splits at the hash and dumps the rest (including newlines) into the
> “branch” without any message about invalid characters. That might be an
> error in our URL parsing… or maybe URLs are allowed to have newlines in
> that part? That would be strange. Either way, I suspect that that bug (if
> it’s a bug) will be hidden by this fix.
>
>
>
> Finally, a million thanks for fixing this; I always have students (and it
> happened again yesterday!) that run into this.
>
>
>
> John
>
>
>
>
>
>
>
> > On Sep 15, 2020, at 07:38, Robby Findler 
> wrote:
>
> >
>
> > I just worry about backwards compatibility. There are probably places
> that already do something about this problem woutside of the control-- how
> will they interact?
>
> >
>
> > Maybe if someone were to audit existing code on the pkg server then we
> would know that changing the behavior in a certain way would work out.
>
> >
>
> > Robby
>
> >
>
> >
>
> > On Tue, Sep 15, 2020 at 12:46 AM Sorawee Porncharoenwase <
> sorawee.pw...@gmail.com> wrote:
>
> > Can you explain why you are not sure? Under what circumstances do you
> think the current 'single style behavior is useful?
>
> >
>
> > We can add 'single-no-return (though I dislike it because 'single means
> no return already!) and change existing places that use 'single. However,
> without switching the default style from 'single to 'single-no-return,
> people will make mistakes again in the future. But if we will change the
> default style to 'single-no-return too, why don't we simply directly change
> the behavior 'single?
>
> >
>
> > On Sun, Sep 13, 2020 at 1:36 PM Robby Findler 
> wrote:
>
> > I'm not sure. I would probably add a 'single-no-return style and then
> grep the codebase for places that use 'single and change them (as
> appropriate).
>
> >
>
> > Robby
>
> >
>
> >
>
> > On Sun, Sep 13, 2020 at 3:15 PM Sorawee Porncharoenwase <
> sorawee.pw...@gmail.com> wrote:
>
> > I meant, wouldn’t it be better to fix text-field% itself, instead of
> only some instances of it? Sorry if that was confusing.
>
> >
>
> >
>
> >
>
> >
>
> > On Sun, Sep 13, 2020 at 1:12 PM Sorawee Porncharoenwase <
> sorawee.pw...@gmail.com> wrote:
>
> > Should the fix apply to all 'single styled text-field% too?
>
> >
>
> >
>
> >
>
> >
>
> > On Sun, Sep 13, 2020 at 7:50 AM Robby Findler 
> wrote:
>
> > Yea, I agree. I'd made that change locally but hadn't pushed because I
> couldn't make the bad behavior happen reliably. Perhaps that lack shouldn't
> stop us! Pushed now.
>
> >
>
> > Robby
>
> >
>
> >
>
> > On Sat, Sep 12, 2020 at 11:15 PM jackh...@gmail.com <
> jackhfi...@gmail.com> wrote:
>
> > Could we make the "do what I mean" box just automatically strip any
> newlines pasted into it? It seems sensible to me to require that it only be
> a single line input.
>
> >
>
> > On Friday, September 11, 2020 at 6:22:59 AM UTC-7 hen...@topoi.pooq.com
> wrote:
>
> > On Thu, Sep 10, 2020 at 10:27:39AM -0400, George Neuner wrote:
>
> >
>
> >
>
> > >
>
> >
>
> >
>
> > >
>
> >
>
> >
>
> > > On 9/10/2020 10:06 AM, Philip McGrath wrote:
>
> >
>
> >
>
> > > > Also, this is happening over encrypted HTTPS: no one is sniffing the
>
> >
>
> >
>
> > > > User-Agent header.
>
> >
>
> >
>
> > >
>
> >
>
> >
>
> > > While it may not be the issue here, you need to understand that
> appliance
>
> >
>
> >
>
> > > firewalls CAN

Re: [racket-users] package manager woes on Windows 10?

2020-09-15 Thread Robby Findler
I just worry about backwards compatibility. There are probably places that
already do something about this problem woutside of the control-- how will
they interact?

Maybe if someone were to audit existing code on the pkg server then we
would know that changing the behavior in a certain way would work out.

Robby


On Tue, Sep 15, 2020 at 12:46 AM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> Can you explain why you are not sure? Under what circumstances do you
> think the current 'single style behavior is useful?
>
> We can add 'single-no-return (though I dislike it because 'single means no
> return already!) and change existing places that use 'single. However,
> without switching the default style from 'single to 'single-no-return,
> people will make mistakes again in the future. But if we will change the
> default style to 'single-no-return too, why don't we simply directly change
> the behavior 'single?
>
> On Sun, Sep 13, 2020 at 1:36 PM Robby Findler 
> wrote:
>
>> I'm not sure. I would probably add a 'single-no-return style and then
>> grep the codebase for places that use 'single and change them (as
>> appropriate).
>>
>> Robby
>>
>>
>> On Sun, Sep 13, 2020 at 3:15 PM Sorawee Porncharoenwase <
>> sorawee.pw...@gmail.com> wrote:
>>
>>> I meant, wouldn’t it be better to fix text-field% itself, instead of
>>> only some instances of it? Sorry if that was confusing.
>>>
>>>
>>>
>>> On Sun, Sep 13, 2020 at 1:12 PM Sorawee Porncharoenwase <
>>> sorawee.pw...@gmail.com> wrote:
>>>
>>>> Should the fix apply to all 'single styled text-field%
>>>> <https://docs.racket-lang.org/gui/text-field_.html> too?
>>>>
>>>>
>>>>
>>>> On Sun, Sep 13, 2020 at 7:50 AM Robby Findler <
>>>> ro...@cs.northwestern.edu> wrote:
>>>>
>>>>> Yea, I agree. I'd made that change locally but hadn't pushed because I
>>>>> couldn't make the bad behavior happen reliably. Perhaps that lack 
>>>>> shouldn't
>>>>> stop us! Pushed now.
>>>>>
>>>>> Robby
>>>>>
>>>>>
>>>>> On Sat, Sep 12, 2020 at 11:15 PM jackh...@gmail.com <
>>>>> jackhfi...@gmail.com> wrote:
>>>>>
>>>>>> Could we make the "do what I mean" box just automatically strip any
>>>>>> newlines pasted into it? It seems sensible to me to require that it only 
>>>>>> be
>>>>>> a single line input.
>>>>>>
>>>>>> On Friday, September 11, 2020 at 6:22:59 AM UTC-7
>>>>>> hen...@topoi.pooq.com wrote:
>>>>>>
>>>>>>> On Thu, Sep 10, 2020 at 10:27:39AM -0400, George Neuner wrote:
>>>>>>>
>>>>>>>
>>>>>>> >
>>>>>>>
>>>>>>>
>>>>>>> >
>>>>>>>
>>>>>>>
>>>>>>> > On 9/10/2020 10:06 AM, Philip McGrath wrote:
>>>>>>>
>>>>>>>
>>>>>>> > > Also, this is happening over encrypted HTTPS: no one is sniffing
>>>>>>> the
>>>>>>>
>>>>>>>
>>>>>>> > > User-Agent header.
>>>>>>>
>>>>>>>
>>>>>>> >
>>>>>>>
>>>>>>>
>>>>>>> > While it may not be the issue here, you need to understand that
>>>>>>> appliance
>>>>>>>
>>>>>>>
>>>>>>> > firewalls CAN and routinely DO examine data inside encrypted
>>>>>>> connections.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Using man-in-the-middle attacks?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -- hendrik
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>> You received this mess

Re: [racket-users] package manager woes on Windows 10?

2020-09-13 Thread Robby Findler
I'm not sure. I would probably add a 'single-no-return style and then grep
the codebase for places that use 'single and change them (as appropriate).

Robby


On Sun, Sep 13, 2020 at 3:15 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> I meant, wouldn’t it be better to fix text-field% itself, instead of only
> some instances of it? Sorry if that was confusing.
>
> On Sun, Sep 13, 2020 at 1:12 PM Sorawee Porncharoenwase <
> sorawee.pw...@gmail.com> wrote:
>
>> Should the fix apply to all 'single styled text-field%
>> <https://docs.racket-lang.org/gui/text-field_.html> too?
>>
>> On Sun, Sep 13, 2020 at 7:50 AM Robby Findler 
>> wrote:
>>
>>> Yea, I agree. I'd made that change locally but hadn't pushed because I
>>> couldn't make the bad behavior happen reliably. Perhaps that lack shouldn't
>>> stop us! Pushed now.
>>>
>>> Robby
>>>
>>>
>>> On Sat, Sep 12, 2020 at 11:15 PM jackh...@gmail.com <
>>> jackhfi...@gmail.com> wrote:
>>>
>>>> Could we make the "do what I mean" box just automatically strip any
>>>> newlines pasted into it? It seems sensible to me to require that it only be
>>>> a single line input.
>>>>
>>>> On Friday, September 11, 2020 at 6:22:59 AM UTC-7 hen...@topoi.pooq.com
>>>> wrote:
>>>>
>>>>> On Thu, Sep 10, 2020 at 10:27:39AM -0400, George Neuner wrote:
>>>>> >
>>>>> >
>>>>> > On 9/10/2020 10:06 AM, Philip McGrath wrote:
>>>>> > > Also, this is happening over encrypted HTTPS: no one is sniffing
>>>>> the
>>>>> > > User-Agent header.
>>>>> >
>>>>> > While it may not be the issue here, you need to understand that
>>>>> appliance
>>>>> > firewalls CAN and routinely DO examine data inside encrypted
>>>>> connections.
>>>>>
>>>>> Using man-in-the-middle attacks?
>>>>>
>>>>> -- 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/84b16cf0-7837-4d54-9423-c1286f5e2b7an%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/racket-users/84b16cf0-7837-4d54-9423-c1286f5e2b7an%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>>> 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/CAL3TdON46%3DPR6_-iyppSMLsfEvNEveq3uGu64gQ3Lu1or7QgNw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/racket-users/CAL3TdON46%3DPR6_-iyppSMLsfEvNEveq3uGu64gQ3Lu1or7QgNw%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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/CADcuegtFzzeErTTqi3m9Hyr%2Bu1m8YEo0cnAEw2onhKXGnTzHOg%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CADcuegtFzzeErTTqi3m9Hyr%2Bu1m8YEo0cnAEw2onhKXGnTzHOg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAL3TdOMGpAWz8Df5CAJNvhdfCyb7CL%2BNocZGYtga6YtZMrjDqg%40mail.gmail.com.


Re: [racket-users] package manager woes on Windows 10?

2020-09-13 Thread Robby Findler
Yea, I agree. I'd made that change locally but hadn't pushed because I
couldn't make the bad behavior happen reliably. Perhaps that lack shouldn't
stop us! Pushed now.

Robby


On Sat, Sep 12, 2020 at 11:15 PM jackh...@gmail.com 
wrote:

> Could we make the "do what I mean" box just automatically strip any
> newlines pasted into it? It seems sensible to me to require that it only be
> a single line input.
>
> On Friday, September 11, 2020 at 6:22:59 AM UTC-7 hen...@topoi.pooq.com
> wrote:
>
>> On Thu, Sep 10, 2020 at 10:27:39AM -0400, George Neuner wrote:
>> >
>> >
>> > On 9/10/2020 10:06 AM, Philip McGrath wrote:
>> > > Also, this is happening over encrypted HTTPS: no one is sniffing the
>> > > User-Agent header.
>> >
>> > While it may not be the issue here, you need to understand that
>> appliance
>> > firewalls CAN and routinely DO examine data inside encrypted
>> connections.
>>
>> Using man-in-the-middle attacks?
>>
>> -- 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/84b16cf0-7837-4d54-9423-c1286f5e2b7an%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/CAL3TdON46%3DPR6_-iyppSMLsfEvNEveq3uGu64gQ3Lu1or7QgNw%40mail.gmail.com.


Re: [racket-users] package manager woes on Windows 10?

2020-09-10 Thread Robby Findler
I was able to follow John's instructions and I get what Shriram had in the
original message, so that seems like it is on the right track.

Confusingly, however, I also seem to be getting this more helpful message:

DrRacket install: invalid package source;
 inferred package name includes disallowed characters
  given: https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git

I can't see how this check gets evaded sometimes (and I cannot seem to get
back to the error state that produced the transcript below) so I didn't try
to push a fix.

But at least that might help SK's students & TAs for now.

Robby


Querying Git references for mystery-languages at
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
pkg: Git checkout initial protocol failed;
 the given URL might not refer to a Git repository
  given URL: https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
https://github.com/shriram/mystery-languages.git
  context...:
   /Users/robby/git/exp/plt/racket/collects/pkg/private/stage.rkt:762:25
   /Users/robby/git/exp/plt/racket/collects/net/git-checkout.rkt:336:0:
parse-initial-refs
   /Users/robby/git/exp/plt/racket/collects/net/git-checkout.rkt:73:8
   dynamic-wind
   call-in-empty-metacontinuation-frame
   /Users/robby/git/exp/plt/racket/collects/net/git-checkout.rkt:54:2:
retry-loop
   dynamic-wind
   call-in-empty-metacontinuation-frame
   dynamic-wind
   call-in-empty-metacontinuation-frame
   /Users/robby/git/exp/plt/racket/collects/pkg/private/stage.rkt:59:2:
lookup-normally
   /Users/robby/git/exp/plt/racket/collects/pkg/private/stage.rkt:107:0:
stage-package/info
   /Users/robby/git/exp/plt/racket/collects/pkg/private/install.rkt:141:0:
install-packages
   /Users/robby/git/exp/plt/racket/collects/pkg/private/install.rkt:925:4
   call-in-empty-metacontinuation-frame
   dynamic-wind

On Thu, Sep 10, 2020 at 8:40 PM Shriram Krishnamurthi 
wrote:

> It's not me doing this, it's a student. I agree this is always a
> possibility. But note that it also happened to a TA. I suppose they could
> all have been making the same mistake.
>
> --
> 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/CAJUf2ySBo9pwA4oyr62%3D-1MxiFLY-F0YL_kA4x-eXXqsbHqQDQ%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/CAL3TdOM5H4RhX5yBF1K4vM-Sd9kqTw5gUKnJRFr3%3DqaOzJ%2B%3Dbw%40mail.gmail.com.


Re: [racket-users] -i as an identifier

2020-09-10 Thread Robby Findler
The r6rs number syntax has explicit cases for +i and -i

   http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2

Robby


On Thu, Sep 10, 2020 at 7:27 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> I think you read the doc correctly, but there are programs that use +i
> and -i, so it's unclear if fixing the reader is desirable. Perhaps the
> documentation should be adjusted instead.
>
> Here’s an example of how people use +i and -i:
> https://github.com/mbutterick/aoc-racket/blob/master/2019/03.rkt#L20
>
> On Thu, Sep 10, 2020 at 3:40 PM Sage Gerard  wrote:
>
>> It looks like -i cannot be used as an identifier because it evaluates to
>> the complex number 0-1i. So in the v7.8 REPL, (define -i "foo") fails. I
>> noticed this when trying to map CLI flag strings to identifiers. -i was the
>> only one in the set to fall over.
>>
>> In the Reading Numbers section of the reference, it looks like a digit
>> sequence is required before "i" for both the inexact complex and exact
>> complex productions. That makes sense to me because it doesn't seem right
>> to assume that an empty string corresponds to -1 like it seems to do here.
>> Maybe I'm misreading the grammar?
>>
>> Before I open a GitHub issue, I just need to know if any part of this is
>> unintentional.
>>
>> *~slg*
>>
>>
>> --
>> 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/s9pqyR4hlcTjjfYYHeNqnVsDKbU138qdy-L0rIquew86_TtTNX4SlRRw2r4Yv2-0szTzJiCmyu4QDmwwfPD863HHRO6oZpT9x1V8GfCmM3E%3D%40sagegerard.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/CADcueguL5rk5jaTsBqeuucCOuHC7NYanw-iA0CoCuBbjSC4TBA%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/CAL3TdONTk9UrXPV%2BFtb%2B6kFCHoaSsiR%2B1JQHS3kUgTw4_czEAw%40mail.gmail.com.


Re: [racket-users] DrRacket docs broken for Safari when opened once from dmg

2020-09-06 Thread Robby Findler
I thought we had fixed things so that DrRacket would detect (and fix) the
problem when restarting. But I can believe that newer version of the OS
defeat our attempts to work around the security things that break this. :(

Robby


On Sun, Sep 6, 2020 at 5:32 PM gfb  wrote:

> I can live with this. It happened because I wanted to see what happens
> with current macOS and DrRacket version, and what it takes to fix it, when
> launching from dmg. Some non-cs 1st year students launch from dmg each term
> despite screenshots, warnings, and demonstrating the correct process in
> lecture. But this term my course is for 3rd year cs students, so (if this
> isn't idiosyncratic) they're less likely to get into the situation or can
> install firefox if they haven't already and switch default browser while
> using drracket.
>
> On Sunday, September 6, 2020 at 6:20:23 PM UTC-4 gfb wrote:
>
>> I tried raco setup first, clearing Safari history and data, toggling
>> javascript, restarting the computer, switching default browser, fresh
>> installs including downloading from a different site to trigger the os
>> asking for permission again. Those all result in the following (which is
>> why I tried some of those things).
>>
>> The doc search within DrRacket goes to
>> "file://private/var/folders/.../plt-sendurl-contents-file-.html",
>> and that page simply says "Please go here" where "here" is a link to
>> "file:///Users/gfb/Library/Racket/7.8/doc/search/index.html" which doesn't
>> work from that link. But copy-pasting the link goes to the search page but
>> without the style sheet applied. The general "Help Desk" documentation is
>> fine, but then clicking on "Search Manuals" goes to a non-functional
>> version of the search page.
>>
>> Everything works in Firefox though, which is why I was thinking some
>> Safari caching or being picky about running some of the javascript for
>> security reasons.
>>
>> On Sunday, September 6, 2020 at 6:02:19 PM UTC-4 Robby Findler wrote:
>>
>>> I recall this as a bug that we fixed. Are you seeing this problem with
>>> the latest version?
>>>
>>> I cannot recall the details anymore, but it might work to run "raco
>>> setup" from the command line (with the raco that's not on the dmg).
>>>
>>> Robby
>>>
>>>
>>> On Sun, Sep 6, 2020 at 3:56 PM gfb  wrote:
>>>
>>>>
>>>> Is there way to reset the documentation state after DrRacket was opened
>>>> from dmg once. The f1 search with Safari as default browser on macOS
>>>> Catalina doesn't work, even after removing ~/Libary/Racket and
>>>> ~/Library/org.racket-lang.prefs.rktd and ~/Libary/PLT-*, ejecting the
>>>> dmg, and re-launching from /Applications/Racket 7.8.
>>>>
>>>> --
>>>> 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/35986d31-1838-4adb-a70c-7740cf6fc52fn%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/racket-users/35986d31-1838-4adb-a70c-7740cf6fc52fn%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
> 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/09f5b0af-64a8-422b-8051-74d6b1418409n%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/09f5b0af-64a8-422b-8051-74d6b1418409n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: [racket-users] DrRacket docs broken for Safari when opened once from dmg

2020-09-06 Thread Robby Findler
I recall this as a bug that we fixed. Are you seeing this problem with the
latest version?

I cannot recall the details anymore, but it might work to run "raco setup"
from the command line (with the raco that's not on the dmg).

Robby


On Sun, Sep 6, 2020 at 3:56 PM gfb  wrote:

>
> Is there way to reset the documentation state after DrRacket was opened
> from dmg once. The f1 search with Safari as default browser on macOS
> Catalina doesn't work, even after removing ~/Libary/Racket and
> ~/Library/org.racket-lang.prefs.rktd and ~/Libary/PLT-*, ejecting the
> dmg, and re-launching from /Applications/Racket 7.8.
>
> --
> 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/35986d31-1838-4adb-a70c-7740cf6fc52fn%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/CAL3TdOPSKqeOri7C75WvvvXni9hBOm5afVARTPg4BZ3soQw%2B_Q%40mail.gmail.com.


Re: [racket-users] drracket -- getting the buffer's current filename?

2020-09-01 Thread Robby Findler
Not sure if this is what you want, but here's a thing:

#lang racket
(define-syntax (my-source stx)
  #`'#,(syntax-source stx))

my-source



On Tue, Sep 1, 2020 at 9:36 AM ibar...@radford.edu 
wrote:

> When running from inside drracket, `(find-system-path 'run-file)`
> understandable returns the DrRacket executable.  Is there a way for me to
> further find the name of the source-file, in that situation?
>
> --Ian
>
>
> --
> 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/88284b4f-7772-4fde-b754-6e06e6dbad57n%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/CAL3TdOMfD-zB7yfTFcykBA6mDzLDNBOcMM%3DFpxdLydmx6SGWTA%40mail.gmail.com.


Re: [racket-users] Re: find-expr: find a corresponding expression in the definition window

2020-08-31 Thread Robby Findler
That's a nice idea! The code that calls current-print can check to see if
the function accepts a specific keyword parameter and, if it does, supply
it with a srcloc.

Robby


On Mon, Aug 31, 2020 at 2:38 PM Greg Hendershott 
wrote:

> I might be misunderstanding and the following isn't some fully-thought-out
> proposal, but:
>
> IIUC both #%module-begin and read-eval-print-loop use current-print.
>
> What if current-print accepted a new, optional srcloc parameter?
>
> And the default #%module-begin were changed to supply this?
>
> That way, a print handler for a plain-text tool^1 could use the srcloc to
> create some sort of "link", as well as Racket GUI tools like DrRacket using
> it to create some fancier UI.
>
> ^1: This includes TUI tools like emacs, as well as GUI tools like vscode
> using a text serialization format like JSON.
>
> --
> 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/6e1d2180-288d-4789-88fc-2980aaf03650o%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/CAL3TdOPY-GwNOE87Wa5C6hEx8Q9bPARWUdD29RVSmg8oXJMucQ%40mail.gmail.com.


Re: [racket-users] printing errors

2020-08-29 Thread Robby Findler
It might make the most sense for you to extract the exn-message and print
it yourself? It should contain only the "a: undefined" part. If you want to
selectively access the stacktrace and decide whether or not to print that
first stackframe, that'll probably require a change to DrRacket, tho -- at
least if you have debugging turned on. (There may be some clever hack I'm
not thinking of, tho, depending on what you want.)

Robby

On Sat, Aug 29, 2020 at 10:11 AM Shriram Krishnamurthi 
wrote:

> Thank you!
>
> Is there a way of further suppressing info? Right now I get output like
>
> [image: image.png] ../../make-semantics.rkt:37:13: a: undefined
>
>
> which is a reference to the language implementation file rather than to
> the program in the language.
>
> The programs here are so small that suppressing everything but the "a:
> undefined" would be great.
>
> --
> 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/CAJUf2yQgBahzMQP-rPOAXM6xWkvAiR0EstzVNLweEYo83A6mEQ%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/CAL3TdON6ThzfELa9pJW_dttFx%2B5MMFig19qFd%3DSQ-Y9rNL60ig%40mail.gmail.com.


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

2020-08-28 Thread Robby Findler
I put a few tweaks that might affect other things more generally (it now
picks the font size more explicitly down to smaller sizes and I fiddled
with the font size adjustment for the buttons in smartphone mode and with
the spacing between the buttons). New version in the usual temporary place:
https://users.cs.northwestern.edu/~robby/tmp/Web/www/

Robby


On Fri, Aug 28, 2020 at 6:43 AM Dominik Pantůček <
dominik.pantu...@trustica.cz> wrote:

> Except for the top links, it is perfect now.
>
> Screenshot attached.
>
> Dominik
>
> On August 27, 2020 3:50:28 PM GMT+02:00, Robby Findler <
> ro...@cs.northwestern.edu> 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+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
>>> <https://groups.google.com/d/msgid/racket-users/e9346cb6-a68d-4f49-9c0c-61165e1881e3n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>
> --
> 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/0C253F94-6BCB-4150-B82B-182A642ED59C%40trustica.cz
> <https://groups.google.com/d/msgid/racket-users/0C253F94-6BCB-4150-B82B-182A642ED59C%40trustica.cz?utm_medium=email_source=footer>
> .
>

-- 
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/CAL3TdOOW4YxMLqK-G%3DAbCshT%2BGcXspSW1%3D1_%3DzEmdnwuUnKdUQ%40mail.gmail.com.


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


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
> <https://groups.google.com/d/msgid/racket-users/e9346cb6-a68d-4f49-9c0c-61165e1881e3n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


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

2020-08-25 Thread Robby Findler
I've put a version that uses 550 pixels as a cutoff here, in case that the
1080 really was 540: https://users.cs.northwestern.edu/~robby/tmp/Web/www/

Robby


On Tue, Aug 25, 2020 at 5:06 PM Robby Findler 
wrote:

> Thanks Dominik. Currently the site uses the predicate "less than 460
> pixels wide?" to determine if it should switch to single-column / phone
> mode. That seemed to work for the 3-4 phones (narrow) and tablets (wide)
> that I tried but I'm certainly not well versed in these kinds of things.
> The specific expression it uses is here:
>
>
> https://github.com/racket/racket-lang-org/blob/master/www/css/styles.css.pp#L543
>
> (and then a bit further down is the negated version of that same
> predicate).
>
> If you (or anyone!) has advice on how to improve this, that'd be welcome.
>
> It may be that the right approach is to adjust the font sizes, as
> 1080x1920 sounds really wide. Is it possible that's a retina-style display
> and the logical number is actually 540 wide? Maybe that's a better cutoff
> for switching?
>
> Robby
>
>
> On Tue, Aug 25, 2020 at 3:45 PM Dominik Pantůček <
> dominik.pantu...@trustica.cz> wrote:
>
>> On 25. 08. 20 22:35, Laurent wrote:
>>
>> > Or maybe Dominik checked something like "Always display the desktop
>>
>> > version for this site"? (FWIW it displays nicely on a 2,280x1,080 pixels
>>
>> > phone screen)
>>
>>
>>
>> I wish that was the case. The screenshot comes from Lightning browser,
>>
>> however I get the same result from Chrome (default on my Cat S61 Phone)
>>
>> and mobile Firefox too.
>>
>>
>>
>> It's 1080x1920 with default Android 9 as shipped by the manufacturer.
>>
>> Actually I am using this device for testing our mobile apps (yes ...).
>>
>>
>>
>> Of course, changing the orientation to landscape makes it display the
>>
>> desktop version correctly.
>>
>>
>>
>> Sadly, I can only help by reporting as much information as possible.
>>
>>
>>
>>
>>
>> Dominik
>>
>>
>>
>> >
>>
>> > On Tue, Aug 25, 2020 at 9:13 PM Robby Findler <
>> ro...@cs.northwestern.edu
>>
>> > <mailto:ro...@cs.northwestern.edu>> wrote:
>>
>> >
>>
>> > It looks like your phone has enough pixels width wise that the site
>>
>> > thinks it is a normal machine (albeit uncomfortably narrow). If
>>
>> > things are slightly narrower you'll see the site changes. I am
>>
>> > attaching two screenshots from my phone.
>>
>> >
>>
>> > Robby
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> > On Tue, Aug 25, 2020 at 2:59 PM Dominik Pantůček
>>
>> > mailto:dominik.pantu...@trustica.cz
>> >>
>>
>> > wrote:
>>
>> >
>>
>> > Hi,
>>
>> >
>>
>> > apparently the new design is not very mobile-friendly as can be
>>
>> > seen on the attached screenshot. If somebody has the skills and
>>
>> > time, this should probably be fixed soon.
>>
>> >
>>
>> > D.
>>
>> >
>>
>> >
>>
>> > On August 25, 2020 7:51:40 PM GMT+02:00, Robby Findler
>>
>> > mailto:ro...@cs.northwestern.edu>>
>>
>> > 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
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> > --
>>
>> > Sent from my Android device with K-9 Mail. Please excuse my
>> brevity.
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> >
>>
>> >

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

2020-08-25 Thread Robby Findler
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/CAL3TdONYQPWY8OsnB2dpto%3D56mytQgtpKKQbVT%2BObV8iwpoNxQ%40mail.gmail.com.


Re: [racket-users] find-expr: find a corresponding expression in the definition window

2020-08-25 Thread Robby Findler
On Tue, Aug 25, 2020 at 3:19 AM Michael Sperber 
wrote:

>
> Technical question for Robby: How should we represent the icon?
> Just a bitmap% object?
>
>
A bitmap is a good choice (safe because the data of the bitmap can be
extracted and then turned into a safe bitmap% object on the drracket side).
And this has me thinking that we also want to take advantage of record-dc
here.

That is, I think a good way to do that is to use the file/convertible
interface (we'd have to add a new option) where values can declare that
they can be turned into the data structure that record-dc produces in some
way (picts and 2htdp/image images would just draw into a record dc and
extra the result). That would allow a lot of different kinds of
drawing-type thingies and would be easy to support.

Robby

-- 
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/CAL3TdOPeLbPrCPL9B1JvCn6wLEWKUSHnaTzJxnUURnVC8Ae91g%40mail.gmail.com.


Re: [racket-users] [scribble] code:hilite for binders

2020-08-23 Thread Robby Findler
I think I've run into this too (but my memory is foggy) and what I did was
have a macro that expands into `code` and also expands into the actual code
but walks over the code and drops things like code:hilite and code:comment.

Robby


On Sun, Aug 23, 2020 at 9:23 AM Éric Tanter  wrote:

> Ok, I “solved” my problem.
>
> The `(define (code:hilite v) v)` is a hack to be able to use `code:hilite`
> in blocks that are executed, not just displayed, but of course that does
> not work when highlighting binders.
>
> The solution is to separate the display from the execution, with a
> separate evaluation in the corresponding evaluator.
>
> The downside is that this forces a duplication of the code (once to
> display with highlight, once to evaluate). I’m still interested in knowing
> if there’s a duplication-free solution to this, but meanwhile I’ll just
> live with it.
>
> — Éric
>
>
>
>
> > On Aug 22, 2020, at 6:25 PM, Éric Tanter  wrote:
> >
> > Just to complement: I’m editing some scribble I wrote years ago and I
> completely forgot why I was doing that, but to be able to use
> `(code:highlight …)` in code blocks, I had to add the following line (where
> `ex-eval` is my base evaluator):
> > ```
> > @interaction-eval[#:eval ex-eval (define (code:hilite v) v) ]
> > ```
> >
> > sorry if that’s confusing, but I’m confused ;-)
> >
> > I just want a way to highlight any bits in a code block, in order to
> bring the reader’s attention to specific places (could be binders, whole
> expressions, etc.).
> >
> > Thanks!
> >
> > — Éric
> >
> >
> >
> >
> >> On Aug 22, 2020, at 6:15 PM, Éric Tanter  wrote:
> >>
> >> Hi,
> >>
> >> From the doc: `(code:hilite datum)` typesets like `datum`, but with a
> background highlight.
> >> However, it does not work to highlight a binder, eg: `(letrec
> ([(code:hilite self) …]) …)`
> >> Is there another way to highlight a binder?
> >>
> >> Thanks,
> >>
> >> — Éric
> >>
> >>
> >>
> >>
> >> --
> >> 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/32CE30FE-9724-4421-9A8B-63780A403A5A%40dcc.uchile.cl
> .
> >
> > --
> > 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/09CDBBC0-8A5B-4573-9CC6-DA41B3DE53C1%40dcc.uchile.cl
> .
>
> --
> 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/1BE55C14-6B08-4FFC-85EA-C6590D84C1E0%40dcc.uchile.cl
> .
>

-- 
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/CAL3TdOPLXFp1%2B%2BaqPS3nEbLE3kiF%2BO-%2BVSei2vJcb-8Ju5Mz1g%40mail.gmail.com.


Re: [racket-users] Deserializing snips from untrusted input

2020-08-20 Thread Robby Findler
I believe that the "other ways to cause harm" that mention applies here,
but this is the docs that explain the thing I'm talking about:

https://docs.racket-lang.org/gui/editor-overview.html?q=snip-class#%28part._editorsnipclasses%29

It would require the attacker put the file on the disk in a collection and
then this would trigger running that code.

There are other ways to trigger running code (e.g., starting up DrRacket)
if the attacker can write to the filesystem into a collection, tho.

Robby


On Thu, Aug 20, 2020 at 2:29 PM Daniel Melcer  wrote:

> To make sure I'm understanding correctly, as long as the code verifies
> that the given snipclass is in (get-the-snip-class-list), it should be
> relatively safe? So the only way that the user would run malicious code in
> this case is if they installed a malicious package first, in which case
> there are easier ways to cause harm.
>
> OTOH, when using the load-file method, the dynamic-require could be an
> issue if a theoretical attacker put a .rkt file at a known path and the
> input to load-file refers to that path.
>
> Daniel
>
> On Thursday, August 20, 2020 at 3:12:00 PM UTC-4 Robby Findler wrote:
>
>> The issue I mention in 157 is different than this one.
>>
>> In this situation, the snipclass needs to be installed somehow before its
>> code will be loaded, but that installation can happen by a require
>> (triggered by the opening of that snip). So it may be that you have code
>> installed in a collection that you do not trust and unmarshalling a snip
>> may load that code.
>>
>> That said, in the code below, I don't think this is happening. In
>> particular, the way that untrusted code may be loaded is because the name
>> of the snipclass follows a specific format and the editor itself is going
>> to do the require.
>>
>> In short, you can treat the `load-file` method of editor<%> as possibly
>> doing a dynamic-require. This may or may not be a problem, of course.
>>
>> (At least I think that that's the only thing here. I may be forgetting
>> something?)
>>
>> Robby
>>
>>
>> On Thu, Aug 20, 2020 at 2:08 PM Sorawee Porncharoenwase <
>> sorawe...@gmail.com> wrote:
>>
>>> I don't know much about this specific case, but see Robby's comment
>>> about how "DrRacket can run user (untrusted) code in certain situations" at
>>> https://github.com/racket/gui/issues/157. A concrete problem I found is
>>> that you can have a snip running `struct->vector` and it will successfully
>>> extract private fields of that struct value, even though it won't be able
>>> to if you do that in normal circumstances.
>>>
>>> On Thu, Aug 20, 2020 at 8:34 AM Daniel Melcer  wrote:
>>>
>>>> There are some well-known vulnerabilities that are a result of
>>>> deserializing untrusted inputs. Are editor snips restrictive enough that
>>>> their deserialization is safe? After all, they are already loaded when a
>>>> file is opened in DrRacket, and a file on the disk may originate from an
>>>> untrusted source. In particular, I would be doing something like this
>>>> (snip-class-name, bytes, and snip-pos are from an untrusted source). The
>>>> whole thing will be wrapped in an exception handler:
>>>>
>>>> (define snip-class (send (get-the-snip-class-list) find
>>>> snip-class-name)) ; Also handle case where this returns #f
>>>> (define bytes-base-in (make-object editor-stream-in-bytes-base%
>>>> bytes))
>>>> (define editor-stream-in (make-object editor-stream-in%
>>>> bytes-base-in))
>>>> (define new-snip (send snip-class read editor-stream-in))
>>>> (send text insert new-snip snip-pos)
>>>>
>>>> Daniel
>>>>
>>>> --
>>>> 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/153d1c59-0343-4ed9-805b-2909499ec98fn%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/racket-users/153d1c59-0343-4ed9-805b-2909499ec98fn%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Racket Users"

Re: [racket-users] Deserializing snips from untrusted input

2020-08-20 Thread Robby Findler
The issue I mention in 157 is different than this one.

In this situation, the snipclass needs to be installed somehow before its
code will be loaded, but that installation can happen by a require
(triggered by the opening of that snip). So it may be that you have code
installed in a collection that you do not trust and unmarshalling a snip
may load that code.

That said, in the code below, I don't think this is happening. In
particular, the way that untrusted code may be loaded is because the name
of the snipclass follows a specific format and the editor itself is going
to do the require.

In short, you can treat the `load-file` method of editor<%> as possibly
doing a dynamic-require. This may or may not be a problem, of course.

(At least I think that that's the only thing here. I may be forgetting
something?)

Robby


On Thu, Aug 20, 2020 at 2:08 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> I don't know much about this specific case, but see Robby's comment about
> how "DrRacket can run user (untrusted) code in certain situations" at
> https://github.com/racket/gui/issues/157. A concrete problem I found is
> that you can have a snip running `struct->vector` and it will successfully
> extract private fields of that struct value, even though it won't be able
> to if you do that in normal circumstances.
>
> On Thu, Aug 20, 2020 at 8:34 AM Daniel Melcer  wrote:
>
>> There are some well-known vulnerabilities that are a result of
>> deserializing untrusted inputs. Are editor snips restrictive enough that
>> their deserialization is safe? After all, they are already loaded when a
>> file is opened in DrRacket, and a file on the disk may originate from an
>> untrusted source. In particular, I would be doing something like this
>> (snip-class-name, bytes, and snip-pos are from an untrusted source). The
>> whole thing will be wrapped in an exception handler:
>>
>> (define snip-class (send (get-the-snip-class-list) find
>> snip-class-name)) ; Also handle case where this returns #f
>> (define bytes-base-in (make-object editor-stream-in-bytes-base%
>> bytes))
>> (define editor-stream-in (make-object editor-stream-in%
>> bytes-base-in))
>> (define new-snip (send snip-class read editor-stream-in))
>> (send text insert new-snip snip-pos)
>>
>> Daniel
>>
>> --
>> 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/153d1c59-0343-4ed9-805b-2909499ec98fn%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/CADcuegtnpb3h_JkDFmBdhiosJkz948ypkhmoj1vZc7vq5SAR0w%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/CAL3TdOMHWqy1FM20OmbV1zB9x3WU%2BzDnbjguW%3D8PHfgfLgbmGw%40mail.gmail.com.


Re: [racket-users] Re: Application Templates!

2020-08-20 Thread Robby Findler
On Thu, Aug 20, 2020 at 9:11 AM Deren Dohoda  wrote:

> I would kill to understand the intended use of the framework library. I
> don't understand what I'm supposed to do with it at all. Does anyone have
> an application written with framework that I can look at? Or could we make
> a small template with some framework features like autosave which are quite
> unique to framework over racket/gui? I feel very stupid asking but my
> desire to try it has exceeded my embarrassment in this regard.
>

The framework is intended to be a collection of mixins that provide useful
functionality in a variety of ways that someone building an app might want.
That said, I agree the documentation could really use some help with
introductory material and some examples and ... I don't know what. So if
people have energy to work on how to do that, I would be delighted.

Here's an example of the kind of thing I'm talking about. This is just
using racket/gui classes:

#lang racket/gui
(define f (new frame% [label ""] [width 200] [height 200]))
(define t (new text%))
(send t insert "#lang racket\n(define (f x)\n  (expt x x))\n")
(define ec (new editor-canvas% [parent f] [editor t]))
(send f show #t)

but we can add a stuff from the framework, say, like this (to get
search/replace to work):

#lang racket/gui
(require framework)
(define f (new frame:searchable% [width 600] [height 800]))
(define t (send f get-editor))
(send t insert "#lang racket\n(define (f x)\n  (expt x x))\n")
(send f show #t)

If we change the editor class that gets created we can get syntax
highlighting based on the #lang-line

#lang racket/gui
(require framework)
(define f%
  (class frame:searchable%
(define/override (get-editor%)
  (text:searching-mixin
   racket:text%))
(super-new)))
(define f (new f% [width 600] [height 800]))
(define t (send f get-editor))
(send t insert "#lang racket\n(define (f x)\n  (expt x x))\n")
(send f show #t)

I've tried to make the framework library's mixins and classes at least
theoretically, be plausibly useful things outside of DrRacket but yes, the
framework and DrRacket have certainly grown together with each other.
Matthew Flatt started them in 1993? 4? and I've been slowly acreeting stuff
into them since (with help from many others, of course!)

Robby

On Thu, Aug 20, 2020 at 9:46 AM Laurent  wrote:

> My understanding is that Framework is born out of DrRacket, expecting that
> some of its tools may be useful in other contexts (like, say, keymaps).
>
>
> On Thu, Aug 20, 2020 at 3:11 PM Deren Dohoda 
> wrote:
>
>> > I think Racket would benefit by a suite of applications which are small
>> but
>> > not trivial and with a source code which is commented in more detail
>> than a
>> > regular application
>> I would kill to understand the intended use of the framework library. I
>> don't understand what I'm supposed to do with it at all. Does anyone have
>> an application written with framework that I can look at? Or could we make
>> a small template with some framework features like autosave which are quite
>> unique to framework over racket/gui? I feel very stupid asking but my
>> desire to try it has exceeded my embarrassment in this regard.
>>
>> Deren
>>
>> --
>> 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/c754b4a3-9073-4ecd-9815-7491ad96cf89n%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/CABNTSaGAHqYPKtU-dTnOQ5ZNO0tMWuTgrRW8w8o2iNeZc7bEYg%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/CAL3TdOMvNSdayRKiU7dpjP-395Jdwuf4j2FUkK3h%3D3e6NCSxqQ%40mail.gmail.com.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-10 Thread Robby Findler
That code is in the framework:
https://github.com/racket/gui/blob/master/gui-lib/framework/private/text-line-numbers.rkt

You might also consider having two text%s, one with the names and one with
the rest. They would scroll independently in that case, but you can hide
the scrollbars on one and override various callbacks to keep them scrolled
to the same place.

Robby


On Mon, Aug 10, 2020 at 2:32 PM Christopher Lemmer Webber <
cweb...@dustycloud.org> wrote:

> Hello,
>
> I'm building a little chat application with Racket.  Overall Racket's
> GUI tools are quite comfortable, and I'm just using Rakcet's text editor
> stuff to build the chat.  But a fairly standard thing to do with chat
> applications is to have text like:
>
> (Beware, fixed width ascii art ahead)
>
>  ..
>  | FooChat Deluxe  [X]|
>  ||
>  | File  Blah |
>  ||
>  |  | It's snowing outside!! | alice   |
>  || In August  | bob |
>  |  | Nevermind, the snow is a representation of | carol   |
>  | | collective anxiety about the world | |
>  || Oh okay it is snowing then | |
>  ||
>  | [Better go get some snow shoes then___] [Send] |
>  ''
>
> The core idea there being that usernames left-align to the text.
>
> I'm not sure what's the nicest way to do this, though I've taken a guess
> that maybe the "Show/Hide Line Numbers" in DrRacket is the best example.
> I'd be happy to look at that but I can't really find it in the drracket
> repository and am not sure where it would be?
>
> (I guess one other complication is that if you copy-pasta text it would
> be great to still be able to copy paste the names too, but I can think
> of some kludgery that might make that possible.)
>
>  - Chris
>
> --
> 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/87lfime1pm.fsf%40dustycloud.org
> .
>

-- 
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/CAL3TdOMxDsWx9ZBHS4ZdA520p27m27v3MfKJopXeHJLFFYpZLA%40mail.gmail.com.


Re: [racket-users] emoji in source code

2020-07-19 Thread Robby Findler
I'm not sure what's going on, but this smily works: ☺

Robby


On Sun, Jul 19, 2020 at 10:55 AM Shriram Krishnamurthi 
wrote:

> I wrote the following program:
>
>   (define /: ')
>
> which at least on my screen looks like
>
>
>
> in Aquamacs and in my browser (modulo dark/light mode).
>
> However, no matter which mode I use in OS X AND which color mode I use in
> DrRacket, the emoji just isn't visible:
>
>
>
> Not the most pressing problem in the world, but figured this is probably
> not desirable.
>
> 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/af814198-b86b-4905-a741-4b59d605ca8co%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/CAL3TdOMS5KWw0cj_jzzWpeO1icNZ1Ez%2BKkjZt%2B3PLiY96BwoaA%40mail.gmail.com.


Re: [racket-users] Re: trying to use futures for some calculations

2020-06-17 Thread Robby Findler
On Wed, Jun 17, 2020 at 8:56 AM Brian Adkins  wrote:

> On Wednesday, June 17, 2020 at 4:50:44 AM UTC-4, Alex Harsanyi wrote:
>>
>>
>> I am trying to speed up an algorithm using futures, but I am getting some
>> unexpected results (and no real speed improvements), and I was wondering if
>> someone more experienced could have a look a the code and tell me what am I
>> doing wrong.
>> [...]
>>
>
> I would *love* to be proven wrong on this, but I think it's rare to be
> able to get decent parallelization in practice using futures. You may have
> better results using places, but it will depend on how the amount of
> processing for a unit compares to the overhead of communicating with the
> places i.e. you may get better results with 2 places than with 8 due to
> place communication overhead. In your case, if it's easy for the places to
> input their own sets of parameters, then the place overhead may be small
> since I think each place would simply need to communicate its best value.
>
>
>
While this may be true, it is also the case that the design of futures is
such that incremental work on the primitives turns into incremental ability
to parallelize programs. So while it is likely to be more work today, it
may also be the case that people putting effort in to help their own
programs will help us turn the corner here. Perhaps this is a place where
an interested contributor can help us out a lot!

Robby

-- 
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/CAL3TdOPnzjMdTEOU%2BdO34B8VAfXzORSVHfXYx6tV-8DVGZ7oXw%40mail.gmail.com.


Re: turtle’s outline on blue plaid as main image in initial window of DrRacket on 2020‐06‐11: an Easter egg and a curiosity (veering off topic for [racket-users])

2020-06-14 Thread Robby Findler
I don't know that there is a direct connection except that some of us
(maybe just me?) love the place that celebrates a holiday there.

https://en.wikipedia.org/wiki/King_Kamehameha_I_Day

In addition to the honu, the pattern in the background is palaka.

Robby


On Sun, Jun 14, 2020 at 12:41 PM Etan Wexler 
wrote:

> On 2020‐06‐11, DrRacket, at initialization, presented to me, instead of
> the Racket logo, a sea turtle’s outline in thick, gray strokes, filled with
> the deep blue and deep red of the Racket logo, against a background of
> plaid of light blue and medium blue. The image is quite appealing, even
> beautiful. What is the association between 2020‐06‐11 and sea turtles?
>
> --
> 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/2020-06-14_DrRacket_Easter_egg_2020-06-11_sea_turtle%40r-6.org
> .
>

-- 
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/CAL3TdONyWMckYzsHCY8rY%2B5RW2UC_r63PwjVqx-xczUUOFgrRA%40mail.gmail.com.


Re: [racket-users] Sandbox + 2htdp/image

2020-05-28 Thread Robby Findler
Just in case, the general phenomenon happening here is that you've got two
instantiations of the image library (I believe that mrlib/image-core is the
essential one that's getting duplicated in this case) so there are two
different sets of structs for the representation of images and the one
doesn't recognize the other.

There are two basic approaches, I guess: you could run everything
image-related inside the sandbox (including, I suppose, turning it into a
bitmap or svg or something) and then getting it out of the sandbox, or you
could share the implementation of the image library between the inside and
outside of the sandbox. The former approach is more secure but maybe less
convenient; the latter is the other way around.

If you wanted to share the implementation you'd have to set up the sandbox
not with a fresh namespace, but with a namespace that already has the same
instantiation of mrlib/image-core as the one you want to use outside the
sandbox.

Robby


On Thu, May 28, 2020 at 5:03 PM Stephen Foster 
wrote:

> I was using the image? predicate as an arbitrary example of something you
> might want to do with an image after extracting it from the sandbox.  What
> if I wanted to pass the result along to beside or overlay?
>
> In all cases, these functions don't recognize the result as an image:
>
> beside: expects an image as first argument, given (object:image% #f #f #f
> #f 1 0 (object:image-snipclass% #f "((lib \"image-core.ss\" \"mrlib\") (lib
> \"image-core-wxme.rkt\" \"mrlib\"))" 1) #0=(object:style% (object:color% 0
> 0 0 1.0 #f) (object:color% 255 255 255 1.0 #f) (object:font% #f 'aligned
> '#(12...
>
> On Tue, May 26, 2020 at 4:58 PM Robby Findler 
> wrote:
>
>> It might be easiest to just use the `image?` predicate from inside the
>> sandbox. Get it out the same way you got the image itself out.
>>
>> Robby
>>
>>
>> On Tue, May 26, 2020 at 6:22 PM Stephen Foster 
>> wrote:
>>
>>> The following returns #f and #t.  How can I get it to return #t and #t?
>>>
>>> Context: I want to allow students to run Racket code on my server. But
>>> when I sandbox their code, I am getting back something that doesn't behave
>>> like a 2htdp/image object.  I'm not exactly sure what it is.
>>>
>>> #lang racket
>>>
>>> (require racket/sandbox 2htdp/image)
>>>
>>> (sandbox-path-permissions
>>>   (list
>>> '(exists
>>>"/usr/lib/ssl/cert.pem")
>>> '(exists
>>>"/usr/lib/ssl/certs")))
>>>
>>> (define user-code '(circle 40 'solid 'red))
>>>
>>> (define circle1
>>>   ((make-evaluator 'racket
>>>`(define f
>>>   (let ()
>>> ,user-code))
>>>#:requires
>>>'(2htdp/image))
>>>'f))
>>>
>>> (define circle2
>>>   (circle 40 'solid 'red))
>>>
>>> (image? circle1) ;#f but I want it to be #t
>>> (image? circle2) ;#t
>>>
>>>
>>> If it helps, when I print out the above values with ~a, I get:
>>>
>>> "#(struct:object:image% ... #(struct:translate 40 40 #(struct:ellipse 80
>>> 80 0 255 red)) #(struct:bb 80 80 80) #f #f #f #f #t)"
>>>
>>> "#(struct:object:image% ...)"
>>>
>>> --
>>> 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/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com
>>> <https://groups.google.com/d/msgid/racket-users/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>
> --
>
>
> Stephen Foster
> ThoughtSTEM Co-Founder
> 318-792-2035
>
> --
> 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/CA%2BzSu29untSJzX0yuyzbOuCiz_xewsgkXBkYHZVnLeHBkwT1mg%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CA%2BzSu29untSJzX0yuyzbOuCiz_xewsgkXBkYHZVnLeHBkwT1mg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAL3TdON9G6n1GAL0e7FA-vGaD_U3Z72KzKHSW1FUoQti44b76w%40mail.gmail.com.


Re: [racket-users] Sandbox + 2htdp/image

2020-05-26 Thread Robby Findler
It might be easiest to just use the `image?` predicate from inside the
sandbox. Get it out the same way you got the image itself out.

Robby


On Tue, May 26, 2020 at 6:22 PM Stephen Foster 
wrote:

> The following returns #f and #t.  How can I get it to return #t and #t?
>
> Context: I want to allow students to run Racket code on my server. But
> when I sandbox their code, I am getting back something that doesn't behave
> like a 2htdp/image object.  I'm not exactly sure what it is.
>
> #lang racket
>
> (require racket/sandbox 2htdp/image)
>
> (sandbox-path-permissions
>   (list
> '(exists
>"/usr/lib/ssl/cert.pem")
> '(exists
>"/usr/lib/ssl/certs")))
>
> (define user-code '(circle 40 'solid 'red))
>
> (define circle1
>   ((make-evaluator 'racket
>`(define f
>   (let ()
> ,user-code))
>#:requires
>'(2htdp/image))
>'f))
>
> (define circle2
>   (circle 40 'solid 'red))
>
> (image? circle1) ;#f but I want it to be #t
> (image? circle2) ;#t
>
>
> If it helps, when I print out the above values with ~a, I get:
>
> "#(struct:object:image% ... #(struct:translate 40 40 #(struct:ellipse 80
> 80 0 255 red)) #(struct:bb 80 80 80) #f #f #f #f #t)"
>
> "#(struct:object:image% ...)"
>
> --
> 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/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%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/CAL3TdOP%3Diwf5PvNk6myn1i4b0qvgx2mC82m2GLKavPqQTxcVaw%40mail.gmail.com.


Re: [racket-users] Finding bound occurrences

2020-05-07 Thread Robby Findler
Does the file without arrows have a syntax error?

Robby


On Thu, May 7, 2020 at 9:55 AM Hendrik Boom  wrote:

> I have several tabs open in DrRacket.
> On two of them, when I mouse over a symbol, it provides very
> visible links to binding or bound occurrences
>
> On the third, it doesn't.  There is a right-click mey item to jump
> to the binding occurrence, but no menu item to find next bound
> occurrence.
>
> One difference I've noticed is that that third tab has
>   #lang racket/base
> instead of
>   #lang typed/racket
> of
>   #lang racket
> like the first two tabs.
>
> Is this a bug or a feature?  Is there soe way I cn persuade it to
> show me bound occurrences even in the third tab/
>
> -- 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/20200507145536.sflodxjyu5n72l3s%40topoi.pooq.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/CAL3TdONwrREEwFygXtVT%3D8ZPjWauL1uuEAfCfq5LRdFZTHnX7w%40mail.gmail.com.


Re: [racket-users] double titlebar effect

2020-05-06 Thread Robby Findler
Looks like a problem with the tabs maybe? How does it look if you make a
new tab?

Robby


On Wed, May 6, 2020 at 3:18 PM Stephen De Gabrielle 
wrote:

> Hi,
> Any other racketeers seeing this?
> [image: image.png]
>
> DrRacket 7.7 cs and macOS Catalina
>
> Kind regards
> Stephen
>
> --
> 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/CAGHj7-KX%3DOWh_iaM70qWJ8YqfCtw30ipVopRd3dSw%2BEEs081ng%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/CAL3TdOO7RkzY6Y9R1fLAtHcym0ibVehOc3xkGxtBJq_ny5T5cg%40mail.gmail.com.


Re: [racket-users] Questions about working on DrRacket and gui

2020-05-05 Thread Robby Findler
On Tue, May 5, 2020 at 10:36 AM Gustavo Massaccesi 
wrote:

> I try to encourage people to participate, but be careful because this task
> is probably too big for a first contribution. GUI is difficult, DrRacket
> has a lot of moving parts, and opening DrRacket inside DrRacket is possible
> but weird.
>
>
+1


> I think the guess of Matthew is correct, it´s a problem with the blue
> arrow with the docs. There is no pause while you type numbers but when you
> type a letter or +-*/... there is a pause of 1 or 2 seconds.
>
> I didn't see the code but my guess is that the docs are loaded lazily in a
> thread and when DrRackets see something like an identifier it waits until
> the thread is ready. It would be nice if the blue arrow is disabled until
> the docs are completely loaded lazily. I think Robby can tell if I'm
> correct and how hard is to fix this.
>
>
Definitely sounds like an extremely actionable hypothesis to investigate
and, if it turns out to be correct, I guess it should be a simple matter of
programming to do what you're suggesting.

Robby

-- 
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/CAL3TdONb7gLOGZ4SEHApoHtfn1kkGmzW0tDQGud2-JL_P65H_Q%40mail.gmail.com.


Re: [racket-users] bitmap% performance

2020-04-23 Thread Robby Findler
On Thu, Apr 23, 2020 at 1:14 PM 'racket' via users-redirect
 wrote:
>
> > Thanks! For the first task I think you probably have to use the raw
> > bitmap% object (since I guess you're using `read-bitmap`).
>
> Hi Robby, I don’t understand how to read a jpeg into a platform-bitmap. 
> Probably I'm missing something in the documentation…

Right-- I agree that that isn't supported currently. I don't know how
difficult it would be to support.

Just a random thought: did you try using the read-bitmap method on the
already created bitmap? I don't know if that would be faster (I wanted
to try before posting but I didn't get there). It may be, however,
that the code inside bitmap% would have to be improved.

Robby

-- 
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/CAL3TdOP-i6soN%2BuLZ4OqsAvtGfDLhr28FE5wYpyWXRtxonK2Bg%40mail.gmail.com.


Re: [racket-users] bitmap% performance

2020-04-23 Thread Robby Findler
Thanks! For the first task I think you probably have to use the raw
bitmap% object (since I guess you're using `read-bitmap`). I'm not
sure if there could be some improvement internally so that screen
bitmaps were used to read in the jpegs. Absent an improvement at that
level, I guess I'd just try caching the conversions.

For the second, I guess you are creating very small bitmaps so
probably this particular creation issue isn't affecting that part? If
you really have a lot of them, you could probably implement some
clever pooling that wasn't keeping all of the jpegs in actual bitmap%
objects all the time but was just keeping ones that were likely to be
looked at soon in bitmap% objects.

hth,
Robby

On Thu, Apr 23, 2020 at 10:05 AM 'racket' via users-redirect
 wrote:
>
> Hi Robby, thanks for your reply.
>
>
> What are you using the bitmap for, exactly? Just to resize the bitmaps? Or as 
> a backing store for drawing into the canvas? Something else?
>
> Both of them.
>
> * I have more than 10K photos in 4000x3000 format that I’d like to download 
> from a webdav server, read exif info, and resize to 960x720 and 320x240
>
> * I should display the thumbnails in a canvas, keeping the system as smooth 
> as possible while scrolling the canvas.
>
> For the first task, if I don’t find any valid alternative, I could use some 
> external tool to resize the images (let’s say libvips or imagemagick) or 
> maybe write some ffi code to use libjpeg. I would prefer this solution over 
> the first one, but I don’t have any experience with ffi coding.
>
>
> Thanks,
>
> Andrea
>
> --
> 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/etPan.5ea1ae9c.ee2bf71.17869%40andreagiardina.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/CAL3TdONHF8qPj35yw0wBjLcHk4eiJL8%3Dmdde%3DcQNBKiB6_0xHg%40mail.gmail.com.


Re: [racket-users] bitmap% performance

2020-04-23 Thread Robby Findler
(My reply to this post bounced on the attempt to send to OP.)

On Wed, Apr 22, 2020 at 3:39 PM 'racket' via users-redirect <
us...@plt-scheme.org> wrote:

>
> Hi,
> I’m writing to the group looking for help with a performance issue.
> I’m coding a gallery like application, using the racket/draw library, but
> the bitmap% class seems to be pretty slow. The (make-bitmap 4000 3000)
> operation takes more than 4 seconds on my computer (a macbook pro with a
> 3.1GHz dual core i5 and 16GB ram).
> What I'd need to do is simply read and resize some jpeg files to display
> them in a canvas. I could use some external program to resize the photos
> but I would prefer to work with racket only. The make-platform-bitmap is 20
> times faster than the make-bitmap, but I didn’t find a way to draw a jpeg
> on it.
> Do you have any suggestion?
>
> Thanks,
> Andrea
>
> --
> 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/etPan.5ea0ab6b.35178ff7.17869%40andreagiardina.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/CAL3TdOPcD4e_HOzO5_t_DXJisvZovOXOFRTA50LbGye2RsVb-g%40mail.gmail.com.


Re: [racket-users] bitmap% performance

2020-04-23 Thread Robby Findler
I don't know that we can help with the specific call you are reporting a
slowdown for (maybe, but I won't address that here as asking other
questions first seems worth doing).

What are you using the bitmap for, exactly? Just to resize the bitmaps? Or
as a backing store for drawing into the canvas? Something else?

Robby

On Wed, Apr 22, 2020 at 3:39 PM 'racket' via users-redirect <
us...@plt-scheme.org> wrote:

>
> Hi,
> I’m writing to the group looking for help with a performance issue.
> I’m coding a gallery like application, using the racket/draw library, but
> the bitmap% class seems to be pretty slow. The (make-bitmap 4000 3000)
> operation takes more than 4 seconds on my computer (a macbook pro with a
> 3.1GHz dual core i5 and 16GB ram).
> What I'd need to do is simply read and resize some jpeg files to display
> them in a canvas. I could use some external program to resize the photos
> but I would prefer to work with racket only. The make-platform-bitmap is 20
> times faster than the make-bitmap, but I didn’t find a way to draw a jpeg
> on it.
> Do you have any suggestion?
>
> Thanks,
> Andrea
>
> --
> 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/etPan.5ea0ab6b.35178ff7.17869%40andreagiardina.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/CAL3TdONjYztUX_MR4yLDf4rR2W_Vswc5J4hDhNKn%2BK5hVdN6PQ%40mail.gmail.com.


Re: [racket-users] visit a sequence of files

2020-04-21 Thread Robby Findler
A (Racket) script that calls "open" (on a mac) and uses some state to keep
track of what "next" means seems straightforward. Probably this can also be
integrated via quickscript so It becomes a key binding. And maybe you want
some small number of key bindings that assign grades and then move on to
the next one?

(Not having tried it :)

Robby

On Tue, Apr 21, 2020 at 4:05 PM 'John Clements' via Racket Users <
racket-users@googlegroups.com> wrote:

> I would love that, but they’re not all in one directory. Maybe the easiest
> solution would be to write a script to temporarily move them all into one
> directory. In fact, as I think about this harder, I realize that the
> biggest problem may be that Apple’s file dialog doesn’t facilitate moving
> along a nested structure in the ways that I want, so temporarily moving
> them into a single directory is almost certainly what I want to do.
>
> Thanks for the ideas!
>
> Related note: it turns out that emacs has “find-dired”, which more or less
> does the same thing, by allowing you to specify a virtual “directory” as a
> set of arguments to ‘find’.
>
> Thanks again,
>
> John
>
> > On Apr 21, 2020, at 1:43 PM, David Storrs 
> wrote:
> >
> > Ah, got it.  Well, as to opening all the files, you can select them all
> in Finder and Cmd+O.  (Presumably the equivalent works on Windows.) Can't
> help you with the aesthetics, sorry.
> >
> > On Tue, Apr 21, 2020 at 4:38 PM John Clements 
> wrote:
> > Well, sure… once you open all the files. Opening all the files is the
> painful part. Also, the display of tabs is not totally great when you have
> sixty or seventy of them open. Sorry, it might not have been clear that I
> want a list of sixty or seventy files.
> >
> > John
> >
> > > On Apr 21, 2020, at 1:34 PM, David Storrs 
> wrote:
> > >
> > > I don't use DrRacket much, but would the normal 'previous / next
> window' commands work for you?  On Mac it's:
> > > previous window:  Shft + Cmd + ~
> > > next window: Cmd + ~
> > >
> > > or
> > >
> > > previous window: Cmd + 
> > > next window: Cmd + 
> > >
> > > On Tue, Apr 21, 2020 at 4:29 PM 'John Clements' via Racket Users <
> racket-users@googlegroups.com> wrote:
> > > Here’s a question I have about both DrRacket and Emacs. It often
> happens in my workflow (grading files, for instance) that I want to set up
> a list of files, and then have an easy way to move forward or back in that
> list (“next file”, “previous file”). I see that emacs has a function called
> “next-file” which can move forward and back in a list of files apparently
> specified by a tags-table file; is that the easiest way to do something
> like this in emacs, or am I missing something obvious? In DrRacket, I’m
> guessing that there’s no existing functionality that would allow me to
> specify a list of files and move back and forth between them. I’m guessing
> I could implement something like this pretty easily … would this be a good
> job for Laurent Orseau’s Quickscript?
> > >
> > > I would absolutely love to hear that I’ve missed something obvious!
> > >
> > > Many thanks!
> > >
> > > John
> > >
> > >
> > >
> > > --
> > > 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/38dfc78b-4d01-4ac1-b1cd-2e4b372c2d09%40mtasv.net
> .
> >
> >
> >
>
>
>
> --
> 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/ba809078-79dc-4773-99c6-00152dcd368f%40mtasv.net
> .
>

-- 
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/CAL3TdOM8HR7qpei-fgnP1FtU9T4k1daFGyxGBtPqaRvX5j1Q4g%40mail.gmail.com.


Re: [racket-users] Re: ask a pict its colour?

2020-04-18 Thread Robby Findler
I basically agree with Alex, as the internal structures of pict don't
really keep information in that way, but a "best effort" might be to
draw it into a bitmap and then use the bitmap to find the average
color or the most common color (perhaps with some error bounds on what
colors count as "the same") or something like that.

Robby

On Sat, Apr 18, 2020 at 6:49 PM Alex Harsanyi  wrote:
>
>
> I don't think such a procedure can be written. at least not for the general 
> case.
>
> First, the color of `(filled-rectangle 30 30)` is not black, but whatever 
> color was installed in the drawing context when the filled rectangle was 
> rendered.  You can change it to red using:
>
> (colorize (filled-rectangle 20 20) "red")
>
> Even if you could inspect the colorize pict, it would still not be sufficient 
> for a general `get-color` function.  Users can write their own pict 
> constructors using dc:
>
>
> (define colors (list "red" "green" "blue" "yellow"))
>
> (define (my-red-colorize other-pict)
>   (dc (lambda (dc dx dy)
>
> (define color (list-ref colors (random (length colors
>
> (define old-pen (send dc get-pen))
> (send dc set-pen (new pen% [width 1] [color color]))
>
> (draw-pict other-pict dc dx dy)
>
> (send dc set-pen old-pen))
>   (pict-width other-pict)
>   (pict-height other-pict)))
>
> And a call like `(my-red-colorize (filled-rectangle 20 20))` will only result 
> in a red rectangle about 25% of the time.
>
> Even if you want to ignore cases like the above, what should `get-color` 
> return for the picture below?
>
> (hc-append (colorize (filled-rectangle 20 20) "red") (colorize 
> (filled-rectangle 20 20) "blue"))
>
>
> Alex.
>
>
> On Saturday, April 18, 2020 at 8:00:12 PM UTC+8, Raoul Schorer wrote:
>>
>> Hi,
>>
>> Using the 'pict' library, I could not find predicates regarding color in the 
>> doc.
>> Is there something like
>>
>> (get-color (filled-rectangle 30 30)) --> "black"
>>
>> somewhere?
>> If not, how can I make a reliable color predicate?
>>
>> Thanks,
>> Raoul
>
> --
> 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/d3fa9021-63af-4129-bfb6-a82e219cfcf0%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/CAL3TdONPB16S1srT1%3Dz0ZPM52%3DZh624hrq5zOc7C4oerXqgaCA%40mail.gmail.com.


Re: [racket-users] Suggestions for "The Racket Guide"

2020-04-08 Thread Robby Findler
The information is there at the source level in the way the evaluators are
used but I guess it gets discarded by the time the code gets to html.

There is also the issue that some of the context code is relevant and some
isn't, so not all of the information is actually there to make the most
compact examples to copy.

Robby

On Wed, Apr 8, 2020 at 12:15 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> Thoughts:
>
> - I take a look at the compiled HTML document. It doesn't seem suffice to
> only change JavaScript because the information about "what is the input" is
> pretty much lost at the HTML level.
> - IIUC, Scribble targets older version of HTML (HTML4?), so it doesn't
> really care about the semantics of tags -- only the appearance is
> considered. It might be possible to add an ad-hoc hack to make this feature
> work, but it would be even better to follow the modern HTML practice in the
> first place, which would make these kind of customization trivial.
>
> On Wed, Apr 8, 2020 at 10:09 AM Ben Greenman 
> wrote:
>
>> On 4/8/20, Stephen De Gabrielle  wrote:
>> > That’s a good suggestion! Do you know the relevant JavaScript we can
>> try it
>> > out with. Might be an easy PR.
>> >
>>
>> Beware that snippets are not always self-contained.
>>
>> A button should grab any requires and earlier code needed to make the
>> example run. That'd be very very useful --- but maybe not so easy.
>>
>> --
>> 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/CAFUu9R5QLaMvnMh4krLZJTBHz%3Dbo1aLv%3DYkS1amF-2yJU55-aw%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/CADcuegsRAXZ8jOTY0Mt52i6X_BD5N%3DjCO8ypyCYrAjBDZomfRQ%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/CAL3TdON1B3FDLTGH2VnJEiq0rCZQc3ZFGRnTvns2S6dW9E%2Bg9A%40mail.gmail.com.


Re: [racket-users] auto-indentation... off by one^H^H^Hsome?

2020-03-21 Thread Robby Findler
I had already merged it but I agree that it could probably stand to
have a little elaboration now. I'll do it.

Robby

On Sat, Mar 21, 2020 at 9:12 PM John Clements  wrote:
>
> Many thanks! Should I cancel my pull request?
>
> John
>
> > On Mar 21, 2020, at 18:34, Robby Findler  wrote:
> >
> > I've pushed something so that racket:text% will indent better when it
> > doesn't have a display.
> >
> > Robby
> >
> > On Fri, Mar 20, 2020 at 4:32 PM John Clements  
> > wrote:
> >>
> >> Made a pull request, many thanks!
> >>
> >> John
> >>
> >>> On Mar 20, 2020, at 1:36 PM, Robby Findler  
> >>> wrote:
> >>>
> >>> Looks right to me!
> >>>
> >>> On Fri, Mar 20, 2020 at 3:26 PM John Clements  
> >>> wrote:
> >>> Could I add a note like this to the docs for the indentation function?
> >>>
> >>> “NB: indentation results depend on the graphical context associated with 
> >>> the object; it may be necessary to associate the object with an 
> >>> editor-canvas and frame in order to get the expected results."
> >>>
> >>> That text might not actually be accurate…
> >>>
> >>> John
> >>>
> >>>> On Mar 20, 2020, at 1:16 PM, John Clements  
> >>>> wrote:
> >>>>
> >>>> Ah! this solves the issue. many thanks.
> >>>>
> >>>>> On Mar 20, 2020, at 1:03 PM, Robby Findler  
> >>>>> wrote:
> >>>>>
> >>>>> Looks like you need a display or the text gets confused about how big
> >>>>> (in pixels) characters really are:
> >>>>>
> >>>>> #lang racket/gui
> >>>>> (require framework)
> >>>>> (define f (new frame% [label ""]))
> >>>>> (define t (new racket:text%))
> >>>>> (define ec (new editor-canvas% [parent f] [editor t]))
> >>>>> (send t insert "(+3\n4)")
> >>>>> (send t freeze-colorer)
> >>>>> (send t tabify-all)
> >>>>> (display (send t get-text))
> >>>>>
> >>>>> On Fri, Mar 20, 2020 at 2:12 PM John Clements 
> >>>>>  wrote:
> >>>>>>
> >>>>>> That actually solves a bunch of problems for me… but strangely, not 
> >>>>>> the initial one. If, for instance, I tabify
> >>>>>>
> >>>>>> (+  3
> >>>>>> 4)
> >>>>>>
> >>>>>> using the tabify-all method, the line with the four gets an 
> >>>>>> indentation of 2, not 8. This is definitely different from DrRacket’s 
> >>>>>> behavior.
> >>>>>>
> >>>>>> Any idea how to fix this?
> >>>>>>
> >>>>>> (cc:ing racket-users without permission, hope that’s okay?)
> >>>>>>
> >>>>>> John
> >>>>>>
> >>>>>>
> >>>>>>> On Mar 20, 2020, at 12:05 PM, John Clements 
> >>>>>>>  wrote:
> >>>>>>>
> >>>>>>> Ah! That’s probably a better solution, I’ll just do that. I searched 
> >>>>>>> for “indent”, should I try to add that as a search term for the 
> >>>>>>> “tabify-all” method?
> >>>>>>>
> >>>>>>> Many thanks!
> >>>>>>>
> >>>>>>> (Also, sending mail to the list using “us...@racket-lang.org” seems 
> >>>>>>> to be broken right now for me, sigh.)
> >>>>>>>
> >>>>>>> John
> >>>>>>>
> >>>>>>>> On Mar 20, 2020, at 12:01 PM, Robby Findler 
> >>>>>>>>  wrote:
> >>>>>>>>
> >>>>>>>> I'm not sure of the details but did you consider just inserting it
> >>>>>>>> into a racket:text% and then calling the tabify-all method?
> >>>>>>>>
> >>>>>>>> Robby
> >>>>>>>>
> >>>>>>>> On Fri, Mar 20, 2020 at 1:26 PM John Clements 
> >>>>>>>>  wrote:
> >>>>>>>>>
> >>>>>>>>> Hmm… follo

Re: [racket-users] auto-indentation... off by one^H^H^Hsome?

2020-03-21 Thread Robby Findler
I've pushed something so that racket:text% will indent better when it
doesn't have a display.

Robby

On Fri, Mar 20, 2020 at 4:32 PM John Clements  wrote:
>
> Made a pull request, many thanks!
>
> John
>
> > On Mar 20, 2020, at 1:36 PM, Robby Findler  
> > wrote:
> >
> > Looks right to me!
> >
> > On Fri, Mar 20, 2020 at 3:26 PM John Clements  
> > wrote:
> > Could I add a note like this to the docs for the indentation function?
> >
> > “NB: indentation results depend on the graphical context associated with 
> > the object; it may be necessary to associate the object with an 
> > editor-canvas and frame in order to get the expected results."
> >
> > That text might not actually be accurate…
> >
> > John
> >
> > > On Mar 20, 2020, at 1:16 PM, John Clements  
> > > wrote:
> > >
> > > Ah! this solves the issue. many thanks.
> > >
> > >> On Mar 20, 2020, at 1:03 PM, Robby Findler  
> > >> wrote:
> > >>
> > >> Looks like you need a display or the text gets confused about how big
> > >> (in pixels) characters really are:
> > >>
> > >> #lang racket/gui
> > >> (require framework)
> > >> (define f (new frame% [label ""]))
> > >> (define t (new racket:text%))
> > >> (define ec (new editor-canvas% [parent f] [editor t]))
> > >> (send t insert "(+3\n4)")
> > >> (send t freeze-colorer)
> > >> (send t tabify-all)
> > >> (display (send t get-text))
> > >>
> > >> On Fri, Mar 20, 2020 at 2:12 PM John Clements 
> > >>  wrote:
> > >>>
> > >>> That actually solves a bunch of problems for me… but strangely, not the 
> > >>> initial one. If, for instance, I tabify
> > >>>
> > >>> (+  3
> > >>> 4)
> > >>>
> > >>> using the tabify-all method, the line with the four gets an indentation 
> > >>> of 2, not 8. This is definitely different from DrRacket’s behavior.
> > >>>
> > >>> Any idea how to fix this?
> > >>>
> > >>> (cc:ing racket-users without permission, hope that’s okay?)
> > >>>
> > >>> John
> > >>>
> > >>>
> > >>>> On Mar 20, 2020, at 12:05 PM, John Clements 
> > >>>>  wrote:
> > >>>>
> > >>>> Ah! That’s probably a better solution, I’ll just do that. I searched 
> > >>>> for “indent”, should I try to add that as a search term for the 
> > >>>> “tabify-all” method?
> > >>>>
> > >>>> Many thanks!
> > >>>>
> > >>>> (Also, sending mail to the list using “us...@racket-lang.org” seems to 
> > >>>> be broken right now for me, sigh.)
> > >>>>
> > >>>> John
> > >>>>
> > >>>>> On Mar 20, 2020, at 12:01 PM, Robby Findler 
> > >>>>>  wrote:
> > >>>>>
> > >>>>> I'm not sure of the details but did you consider just inserting it
> > >>>>> into a racket:text% and then calling the tabify-all method?
> > >>>>>
> > >>>>> Robby
> > >>>>>
> > >>>>> On Fri, Mar 20, 2020 at 1:26 PM John Clements 
> > >>>>>  wrote:
> > >>>>>>
> > >>>>>> Hmm… followup problem. If I try to indent the string “#|\nabc\n|#” 
> > >>>>>> (that is, a block comment), the compute-racket-amount-to-indent 
> > >>>>>> method returns #f. Is this a bug, or just undocumented behavior?
> > >>>>>>
> > >>>>>> John
> > >>>>>>
> > >>>>>>> On Mar 20, 2020, at 10:41 AM, John Clements 
> > >>>>>>>  wrote:
> > >>>>>>>
> > >>>>>>> I’m writing code to help me grade exams, and one of the issues I’ve 
> > >>>>>>> run into is that the code coming out of the LMS is all totally 
> > >>>>>>> unindented. So, for instance, a student’s response might read:
> > >>>>>>>
> > >>>>>>> ;Closures help a function value remember what substitutions have 
> > >>>>>>> already been applied

Re: [racket-users] auto-indentation... off by one^H^H^Hsome?

2020-03-20 Thread Robby Findler
Looks right to me!

On Fri, Mar 20, 2020 at 3:26 PM John Clements 
wrote:

> Could I add a note like this to the docs for the indentation function?
>
> “NB: indentation results depend on the graphical context associated with
> the object; it may be necessary to associate the object with an
> editor-canvas and frame in order to get the expected results."
>
> That text might not actually be accurate…
>
> John
>
> > On Mar 20, 2020, at 1:16 PM, John Clements 
> wrote:
> >
> > Ah! this solves the issue. many thanks.
> >
> >> On Mar 20, 2020, at 1:03 PM, Robby Findler 
> wrote:
> >>
> >> Looks like you need a display or the text gets confused about how big
> >> (in pixels) characters really are:
> >>
> >> #lang racket/gui
> >> (require framework)
> >> (define f (new frame% [label ""]))
> >> (define t (new racket:text%))
> >> (define ec (new editor-canvas% [parent f] [editor t]))
> >> (send t insert "(+3\n4)")
> >> (send t freeze-colorer)
> >> (send t tabify-all)
> >> (display (send t get-text))
> >>
> >> On Fri, Mar 20, 2020 at 2:12 PM John Clements <
> cleme...@brinckerhoff.org> wrote:
> >>>
> >>> That actually solves a bunch of problems for me… but strangely, not
> the initial one. If, for instance, I tabify
> >>>
> >>> (+  3
> >>> 4)
> >>>
> >>> using the tabify-all method, the line with the four gets an
> indentation of 2, not 8. This is definitely different from DrRacket’s
> behavior.
> >>>
> >>> Any idea how to fix this?
> >>>
> >>> (cc:ing racket-users without permission, hope that’s okay?)
> >>>
> >>> John
> >>>
> >>>
> >>>> On Mar 20, 2020, at 12:05 PM, John Clements <
> cleme...@brinckerhoff.org> wrote:
> >>>>
> >>>> Ah! That’s probably a better solution, I’ll just do that. I searched
> for “indent”, should I try to add that as a search term for the
> “tabify-all” method?
> >>>>
> >>>> Many thanks!
> >>>>
> >>>> (Also, sending mail to the list using “us...@racket-lang.org” seems
> to be broken right now for me, sigh.)
> >>>>
> >>>> John
> >>>>
> >>>>> On Mar 20, 2020, at 12:01 PM, Robby Findler <
> ro...@cs.northwestern.edu> wrote:
> >>>>>
> >>>>> I'm not sure of the details but did you consider just inserting it
> >>>>> into a racket:text% and then calling the tabify-all method?
> >>>>>
> >>>>> Robby
> >>>>>
> >>>>> On Fri, Mar 20, 2020 at 1:26 PM John Clements <
> cleme...@brinckerhoff.org> wrote:
> >>>>>>
> >>>>>> Hmm… followup problem. If I try to indent the string “#|\nabc\n|#”
> (that is, a block comment), the compute-racket-amount-to-indent method
> returns #f. Is this a bug, or just undocumented behavior?
> >>>>>>
> >>>>>> John
> >>>>>>
> >>>>>>> On Mar 20, 2020, at 10:41 AM, John Clements <
> cleme...@brinckerhoff.org> wrote:
> >>>>>>>
> >>>>>>> I’m writing code to help me grade exams, and one of the issues
> I’ve run into is that the code coming out of the LMS is all totally
> unindented. So, for instance, a student’s response might read:
> >>>>>>>
> >>>>>>> ;Closures help a function value remember what substitutions have
> already been applied to it.
> >>>>>>> '{vars {{x {lam {x} {+ 1 x}}}
> >>>>>>> {y {lam {y} {+ 3 y
> >>>>>>> {+ {x 2} {y 4}}}
> >>>>>>>
> >>>>>>> Obviously, it would be a lot easier to grade that if it was
> indented.
> >>>>>>>
> >>>>>>> Excellent! A chance to whip up a quick-and-dirty auto-indenter,
> using DrRacket’s indentation framework. Specifically, the
> `compute-racket-amount-to-indent` method of racket:text<%>.
> >>>>>>>
> >>>>>>> I’m pleased to report almost total success, aside from one strange
> off-by-one error that I’m looking for help with.  To see it, here’s the
> result of my auto-indenter on the prior block:
> >>>>>>>
> >>>>>>> '{vars {{x {lam {x} {+ 1 x}}}
> >&g

[racket-users] Re: auto-indentation... off by one^H^H^Hsome?

2020-03-20 Thread Robby Findler
Looks like you need a display or the text gets confused about how big
(in pixels) characters really are:

#lang racket/gui
(require framework)
(define f (new frame% [label ""]))
(define t (new racket:text%))
(define ec (new editor-canvas% [parent f] [editor t]))
(send t insert "(+3\n4)")
(send t freeze-colorer)
(send t tabify-all)
(display (send t get-text))

On Fri, Mar 20, 2020 at 2:12 PM John Clements  wrote:
>
> That actually solves a bunch of problems for me… but strangely, not the 
> initial one. If, for instance, I tabify
>
> (+  3
>   4)
>
> using the tabify-all method, the line with the four gets an indentation of 2, 
> not 8. This is definitely different from DrRacket’s behavior.
>
> Any idea how to fix this?
>
> (cc:ing racket-users without permission, hope that’s okay?)
>
> John
>
>
> > On Mar 20, 2020, at 12:05 PM, John Clements  
> > wrote:
> >
> > Ah! That’s probably a better solution, I’ll just do that. I searched for 
> > “indent”, should I try to add that as a search term for the “tabify-all” 
> > method?
> >
> > Many thanks!
> >
> > (Also, sending mail to the list using “us...@racket-lang.org” seems to be 
> > broken right now for me, sigh.)
> >
> > John
> >
> >> On Mar 20, 2020, at 12:01 PM, Robby Findler  
> >> wrote:
> >>
> >> I'm not sure of the details but did you consider just inserting it
> >> into a racket:text% and then calling the tabify-all method?
> >>
> >> Robby
> >>
> >> On Fri, Mar 20, 2020 at 1:26 PM John Clements  
> >> wrote:
> >>>
> >>> Hmm… followup problem. If I try to indent the string “#|\nabc\n|#” (that 
> >>> is, a block comment), the compute-racket-amount-to-indent method returns 
> >>> #f. Is this a bug, or just undocumented behavior?
> >>>
> >>> John
> >>>
> >>>> On Mar 20, 2020, at 10:41 AM, John Clements  
> >>>> wrote:
> >>>>
> >>>> I’m writing code to help me grade exams, and one of the issues I’ve run 
> >>>> into is that the code coming out of the LMS is all totally unindented. 
> >>>> So, for instance, a student’s response might read:
> >>>>
> >>>> ;Closures help a function value remember what substitutions have already 
> >>>> been applied to it.
> >>>> '{vars {{x {lam {x} {+ 1 x}}}
> >>>> {y {lam {y} {+ 3 y
> >>>> {+ {x 2} {y 4}}}
> >>>>
> >>>> Obviously, it would be a lot easier to grade that if it was indented.
> >>>>
> >>>> Excellent! A chance to whip up a quick-and-dirty auto-indenter, using 
> >>>> DrRacket’s indentation framework. Specifically, the 
> >>>> `compute-racket-amount-to-indent` method of racket:text<%>.
> >>>>
> >>>> I’m pleased to report almost total success, aside from one strange 
> >>>> off-by-one error that I’m looking for help with.  To see it, here’s the 
> >>>> result of my auto-indenter on the prior block:
> >>>>
> >>>> '{vars {{x {lam {x} {+ 1 x}}}
> >>>>  {y {lam {y} {+ 3 y
> >>>>{+ {x 2} {y 4}}}
> >>>>
> >>>> (if you’re viewing this in a proportional-width font, that’s going to 
> >>>> look terrible, sorry.)
> >>>>
> >>>> The issue is that the final plus line isn’t lined up with the 
> >>>> curly-brace that’s two chars after the end of `vars`… instead, it’s one 
> >>>> character to the left.
> >>>>
> >>>> A much simpler test case is simply running on “(+ 3\n4)”. Rather than 
> >>>> getting the 4 lined up with the 3, I get it one character to the left.
> >>>>
> >>>> And… uh oh. A more illuminating test case occurs when I run my code on 
> >>>> “(+  3\n4)”. That is, I put a bunch more spaces before the 3. After 
> >>>> indentation, the 4 is still only indented by two characters. So it looks 
> >>>> like the `compute-racket-amount-to-indent` method is not looking for the 
> >>>> token following the first one following the paren in the prior line 
> >>>> (which would account for all the spaces), but just adding one to the 
> >>>> last position of the first token following the paren. This makes me 
> >>>> wonder whether DrRacket actually uses this method to indent.
> >>>>
> 

Re: [racket-users] Logger shows lots of info messages about collapsible-contract-bailout and collapsible-value-bailout

2020-03-14 Thread Robby Findler
Definitely not something to worry about!

Robby

On Sat, Mar 14, 2020 at 8:59 AM  wrote:

>
> Hi everyone,
>
> I was debugging my program using the logging facilities, and I was getting
> a lot of the following messages at level info:
>
> [ info] collapsible-contract-bailout: arrow: has optional args
> [ info] collapsible-contract-bailout: arrow: has keyword args
> [ info] collapsible-contract-bailout: arrow: no rngs
> [ info] collapsible-contract-bailout: arrow: no rngs
> [ info] collapsible-contract-bailout: arrow: multiple return values
> [ info] collapsible-value-bailout: arrow: can't prove single-return-value
> [ info] collapsible-value-bailout: arrow: can't prove single-return-value
> [ info] collapsible-value-bailout: arrow: can't prove single-return-value
> [ info] collapsible-value-bailout: arrow: can't prove single-return-value
> [ info] collapsible-value-bailout: arrow: can't prove single-return-value
> [ info] collapsible-value-bailout: arrow: can't prove single-return-value
> [ info] collapsible-value-bailout: arrow: can't prove single-return-value
> [ info] collapsible-contract-bailout: arrow: no rngs
> [ info] collapsible-contract-bailout: arrow: no rngs
> 
>
>
> I don't know what triggers it and google does not return any results.
> Just curious, is it something I should be worried about?
> I am using Racket v7.5 if it helps.
>
>
> Best regards.
>
> --
> 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/335c16fb6d4ce69c5b03508eddfe9b7c%40disroot.org
> 
> .
>

-- 
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/CAL3TdOMGS53iENv0xGNxh8SSs0_%2BV%3DCYLRiXdfStEMBsdo2OQQ%40mail.gmail.com.


Re: [racket-users] Using DrRacket interface language with scribble

2020-03-08 Thread Robby Findler
I hate to be a party pooper here but I think the first response is
incorrect. None of the programming language proper is translated; just the
IDE. I think this one translation is probably not what was intended.

Maybe someday someone can take on a Chinese version of the teaching
languages, hopefully!

Robby

On Sun, Mar 8, 2020 at 10:47 AM Chongkai Zhu 
wrote:

> In DrRacket, if I set interface language to Chinese, I can get
>
> > (check-satisfied 1 odd?)
> 测试通过!
>
> That is, the output of check-satisfied is also in Chinese. But with
> scribble/eval (https://docs.racket-lang.org/scribble/eval.html), in the
> .html generated by scribble, I always get
>
> > (check-satisfied 1 odd?)
> The only test passed!
>
> How could I get the same Chinese output in the html output? Thanks.
>
>
> --
> 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/c608fcea-a770-4c57-ab2a-90da49c0508a%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/CAL3TdOP2yKqcd%2B9JFdACANPyRiUtL6ztL6XqHumsP6BTQa%3Dd_w%40mail.gmail.com.


Re: [racket-users] re-run really fast!

2020-03-05 Thread Robby Findler
Some time ago (a lot more than a week), DrRacket started using the result
of online expansion to run (look for the spiky green ball to know when it
will work). It doesn't work in error trace mode tho.

Could that be it?

Robby

On Thu, Mar 5, 2020 at 12:25 AM 'John Clements' via users-redirect <
us...@plt-scheme.org> wrote:

> Okay, I’m probably under a rock and just haven’t read my e-mail in a week,
> but … I just noticed that re-running a long TR file of 900 lines took ONE
> second, rather than eleven. It appears to me that either TR or DrRacket or
> both are now cooperating to not re-compile when no edits have been made. Is
> that a recent change, or am I just easily pleased?
>
> John
>
> --
> 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/0dd2ace8-3633-42d3-8e4d-943bf5f62791%40mtasv.net
> .
>

-- 
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/CAL3TdOOwv7DeiySjai13nTYK6GCP-N5V7o_6eqGRdz2ZZxGc4A%40mail.gmail.com.


Re: [racket-users] Today’s Easter egg?

2020-03-02 Thread Robby Findler
Yes. Racket was born in Texas, so it is an homage (not a political statement :)

On Mon, Mar 2, 2020 at 2:26 PM Stephen De Gabrielle
 wrote:
>
> Hi,
>
> Is the star/lambda Easter egg something to do with independence? (Referencing 
> Texas March 2nd)
>
> S.
> --
> 
>
> --
> 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/CAGHj7-%2BqQc35jKfntebKYvRxYMxT4O4xpPw1iyKf4d7UH%2B3zdQ%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/CAL3TdOPsvRhzkExR-439P0e0pDiZQK%2BEjU34QqrCiqNpJw9juA%40mail.gmail.com.


Re: [racket-users] a little bug

2020-02-28 Thread Robby Findler
Oh, sorry-- I misunderstood.

In v7.5, there will be, in some cases, a source location after you
dismiss that dialog. In the pre-release builds, that's been improved
somewhat and source location information is more reliably available.
That said, there are limitations and it isn't always available.

Thanks for using DrR!

Robby

On Fri, Feb 28, 2020 at 6:31 AM Hendrik Boom  wrote:
>
> On Fri, Feb 28, 2020 at 06:02:31AM -0600, Robby Findler wrote:
> > I agree that would be great. In the meantime, the Run button does a better
> > job with error reporting in various ways, including this one so hopefully
> > you can try that?
>
> That's what I was using.  There was a popup message that wasn't any more
> informative.
> It says:
>
> - The evaluation thread is no longer running, so
>   no evaluation can take place until the next
>   execution.
>
>   The program ran out of memory.
>   [V]Show thid dialog ext time
> [Increase memory limit to 256 megabytes][OK]
>
> I'm mentioning this to indicate a way the drracket uer-interface can be
> improved, especially for beginners.
>
> I'm not asking Racket maintainers to step in and debug my code.
>
> (Further analysis (by deleting code until there was almost nothing left)
> indicates it crashed during processing the #lang line at the start.
> I have started private correspondence with the language author.)
>
> -- hendrik
> >
> > Robby
> >
> > On Fri, Feb 28, 2020 at 5:45 AM Hendrik Boom  wrote:
> >
> > >
> > > When Racket detects the out-of-memory condition during "background
> > > processing", it would be useful i the out-of-memory message were to point
> > > out which particular piece of source text it was having trouble with.  
> > > Just
> > > the line number where the expression started that the REPL was having
> > > trouble with would be a huge help.
> > >
> > > And by the way, if Dr. Racket were to be a she, she would be addressed in
> > > Quebec as Dre. Racket.
> > >
> > > On Friday, 5 February 2016 19:19:46 UTC-5, jon stenerson wrote:
> > >
> > >> lol. Don't be sorry.  Speaking of anthropomorphization, I really love Dr
> > >> Racket and hope I didn't hurt his feelings (Or is Dr Racket a she?). I
> > >> employ his services whenever I can. I don't mean to be a whiner; he
> > >> deserves better than that!
> > >>
> > >> Jon
> > >>
> > >> On 2/5/2016 3:44 PM, Robby Findler wrote:
> > >> > Sorry we can't do better. And it is really amazing how I actually
> > >> > think so anthropomorphically about these things. :) That really was a
> > >> > literal brain dump.
> > >> >
> > >> > Robby
> > >> >
> > >> > On Fri, Feb 5, 2016 at 3:53 PM, jon stenerson 
> > >> wrote:
> > >> >> Thanks for the explanation. I appreciate it.
> > >> >>
> > >> >>
> > >> >> On 2/5/2016 1:55 PM, Robby Findler wrote:
> > >> >>> In general, DrRacket does not promise to avoid this situation. Let me
> > >> >>> explain a little bit. This program is effectively equivalent to this
> > >> >>> one:
> > >> >>>
> > >> >>> #lang racket/base
> > >> >>> (define (run l)
> > >> >>> (run (cons 'x l)))
> > >> >>> (run '())
> > >> >>>
> > >> >>> (but running at compile time, which is why things happen
> > >> >>> automatically, but lets leave that aside for now).
> > >> >>>
> > >> >>> So when you run that program, DrRacket is asking the operating system
> > >> >>> for all of its memory. At some point, the operating system says
> > >> >>> "sorry, no, we're out of memory" and since the program running inside
> > >> >>> DrRacket doesn't really care that we're out of memory, the operating
> > >> >>> system responds with "die!". And so DrRacket dies.
> > >> >>>
> > >> >>> There are two ways we try to do better. First: we can set limits on
> > >> >>> the memory. But if the limit is set to be higher than the amount of
> > >> >>> memory available on the machine, then it is as if the memory limit
> > >> >>> isn't set. Also worth noting at this point: the way that DrRacket's
> > >> >>> 

Re: [racket-users] a little bug

2020-02-28 Thread Robby Findler
I agree that would be great. In the meantime, the Run button does a better
job with error reporting in various ways, including this one so hopefully
you can try that?

Robby

On Fri, Feb 28, 2020 at 5:45 AM Hendrik Boom  wrote:

>
> When Racket detects the out-of-memory condition during "background
> processing", it would be useful i the out-of-memory message were to point
> out which particular piece of source text it was having trouble with.  Just
> the line number where the expression started that the REPL was having
> trouble with would be a huge help.
>
> And by the way, if Dr. Racket were to be a she, she would be addressed in
> Quebec as Dre. Racket.
>
> On Friday, 5 February 2016 19:19:46 UTC-5, jon stenerson wrote:
>
>> lol. Don't be sorry.  Speaking of anthropomorphization, I really love Dr
>> Racket and hope I didn't hurt his feelings (Or is Dr Racket a she?). I
>> employ his services whenever I can. I don't mean to be a whiner; he
>> deserves better than that!
>>
>> Jon
>>
>> On 2/5/2016 3:44 PM, Robby Findler wrote:
>> > Sorry we can't do better. And it is really amazing how I actually
>> > think so anthropomorphically about these things. :) That really was a
>> > literal brain dump.
>> >
>> > Robby
>> >
>> > On Fri, Feb 5, 2016 at 3:53 PM, jon stenerson 
>> wrote:
>> >> Thanks for the explanation. I appreciate it.
>> >>
>> >>
>> >> On 2/5/2016 1:55 PM, Robby Findler wrote:
>> >>> In general, DrRacket does not promise to avoid this situation. Let me
>> >>> explain a little bit. This program is effectively equivalent to this
>> >>> one:
>> >>>
>> >>> #lang racket/base
>> >>> (define (run l)
>> >>> (run (cons 'x l)))
>> >>> (run '())
>> >>>
>> >>> (but running at compile time, which is why things happen
>> >>> automatically, but lets leave that aside for now).
>> >>>
>> >>> So when you run that program, DrRacket is asking the operating system
>> >>> for all of its memory. At some point, the operating system says
>> >>> "sorry, no, we're out of memory" and since the program running inside
>> >>> DrRacket doesn't really care that we're out of memory, the operating
>> >>> system responds with "die!". And so DrRacket dies.
>> >>>
>> >>> There are two ways we try to do better. First: we can set limits on
>> >>> the memory. But if the limit is set to be higher than the amount of
>> >>> memory available on the machine, then it is as if the memory limit
>> >>> isn't set. Also worth noting at this point: the way that DrRacket's
>> >>> counting of "how much memory" is only loosely related to the way that
>> >>> your machine's vendor or the OS counts. There are some constant
>> >>> factors of difference there that depend on things like how the
>> garbage
>> >>> collector is configured and how many other programs are running on
>> >>> your system and what they are doing (like the OS itself likes to have
>> >>> some of the memory and it (quite reasonably) doesn't want to share
>> >>> that memory).
>> >>>
>> >>> The second way is that the OS will sometimes say "you are about to
>> >>> cause me to exhaust all of the system's memory and if you do that, I
>> >>> will kill you" at which point the GC inside Racket responds with
>> >>> "okay, I'll just die first". The main advantage of this is that you
>> >>> get an error message saying "out of memory" from Racket instead of an
>> >>> error message saying "I killed your program" from the OS (which is
>> the
>> >>> message you're getting). It turns out to be remarkably difficult to
>> >>> get this error message to work in all situations. We're better than
>> we
>> >>> used to be at it, but at some level, the best we can do in that case
>> >>> is really just to change the text of the error message. When we're
>> out
>> >>> of memory like that, it's very very hard to recover if the limits are
>> >>> not set up ahead of time (i.e. back to the previous paragraph).
>> >>>
>> >>> I hope this clears up the issue somewhat.
>> >>>
>> >>> In the meantime, I suggest you lower the memory limit f

Re: [racket-users] How to stream file uploads with the Racket web server?

2020-02-14 Thread Robby Findler
It is possible that your post wasn't deleted but got held up in
google's spam traps. I just approved a message from you (that I was
alerted to only this morning). Was that the message?

Robby

On Thu, Feb 13, 2020 at 2:57 PM Brian Adkins  wrote:
>
> I tried replying earlier today, but somehow the post got deleted - could've 
> been user error I suppose.
>
> Anyway, the gist of the response was how I continue to be amazed by how often 
> I get pleasant surprises with Racket - either there is some facility to do 
> what I want that I just haven't found yet, or in this case where there soon 
> will be :)
>
> I have a couple Racket web apps in production now, so I think I have enough 
> real world examples to begin extracting code into a web framework. Although 
> it will look significantly different than Rails (more functional, less object 
> oriented), I'm hoping to achieve similar ease-of-use functionality. I first 
> viewed the Rails "weblog in 15 minutes" video fourteen years ago, and it had 
> a significant impact on my professional life (at the time I was working in 
> Java w/ Spring & Hibernate, etc.). The video is dated now & has some annoying 
> idiosyncrasies, but if you haven't seen it, and you're interested in web 
> development (in any language), it's worth viewing just to get the overview of 
> Rails ease of use:
>
> https://www.youtube.com/watch?v=Gzj723LkRJY=youtu.be
>
> On Thursday, February 13, 2020 at 11:02:33 AM UTC-5, bogdan wrote:
>>
>> The version of the web-server that will be included with Racket 7.6
>> changes the way file uploads are handled so that they get offloaded to
>> disk after a certain threshold (similar to how that nginx module you
>> linked to works).
>>
>> You can check out the pre-release docs for details:
>>
>> * 
>> https://pre-release.racket-lang.org/doc/web-server/http.html?q=binding%3Afile#%28def._%28%28lib._web-server%2Fhttp%2Frequest-structs..rkt%29._make-binding~3afile%2Fport%29%29
>> * 
>> https://pre-release.racket-lang.org/doc/web-server-internal/dispatch-server-unit.html#%28part._safety-limits%29
>>
>> To get these changes ahead of the release, you should be able to install
>> an updated version of `web-server-lib' from the package server or from git.
>>
>> Hope that helps!
>>
>> - Bogdan
>>
>> Brian Adkins writes:
>>
>> > I'm posting a file to my web app using the following form:
>> >
>> > > >   method="post" *enctype="multipart/form-data"*
>> > class="file-upload-form">
>> > ...
>> > 
>> >
>> > I use a simple function to create a hashtable of attributes:
>> >
>> > (define (form-values req)
>> >   (for/hash ([ b (in-list (request-bindings/raw req)) ])
>> > (cond [ (binding:form? b) (values
>> >(bytes->string/utf-8 (binding-id b) #\space)
>> >(bytes->string/utf-8 (binding:form-value b)
>> > #\space)) ]
>> >   [ (binding:file? b) (values
>> >(bytes->string/utf-8 (binding-id b) #\space)
>> >(binding:file-content b)) ])))
>> >
>> > It appears that the entire file contents are in the binding by the time the
>> > request is available to me. This is fine for "small enough" files, but for
>> > larger files, it would be great to be able to stream the file contents. The
>> > solution may be to use something like nginx's upload module:
>> >
>> > https://www.nginx.com/resources/wiki/modules/upload/
>> >
>> > But before I go down that route, I thought I'd ask if the Racket web server
>> > provides a more direct way to accomplish this.
>> >
>> > Thanks,
>> > Brian
>
> --
> 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/6a3298ff-a40c-4a6e-9f16-b1c95144e482%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/CAL3TdOO%3DgfxA3H6o92qmSogygwRaTMZHYi62Sio_db6%2BkrKzKA%40mail.gmail.com.


Re: [racket-users] pinning in pict

2020-01-28 Thread Robby Findler
It might affect other Picts inside, but if there aren't any, then yes.

Robby

On Tue, Jan 28, 2020 at 3:22 PM Benjamin Lerner  wrote:

> Wouldn't `(panorama (pin-over base dx dy pict))` handle this?
>
>
> On 1/28/20 3:42 PM, Robby Findler wrote:
>
> You can cc-superimpose with a blank pict (perhaps that you get via
> ghost/launder). Does that help?
>
> Robby
>
> On Tue, Jan 28, 2020 at 2:39 PM Hendrik Boom 
> wrote:
>
>> Isn't there something like pin-over and pin-under which extends the
>> bounding
>> box to contain both the 'base' and the pict being written over ot
>> under it?
>>
>> The version with dx and dy would be fine for me, especially if dx and/or
>> dy can be negative.
>>
>> -- 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/20200128203855.igwnxy36a6iontjc%40topoi.pooq.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/CAL3TdOP3%3DOyC6D9QbrL1KpdXW4PEBwwyCr3xiNN1tZnnTY9PCg%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAL3TdOP3%3DOyC6D9QbrL1KpdXW4PEBwwyCr3xiNN1tZnnTY9PCg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
>
>

-- 
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/CAL3TdOPQJ6Cer4PKgJkp4UVFzwYJ-Z8m2TZmiRCzbRxDU-%2Bvjg%40mail.gmail.com.


Re: [racket-users] pinning in pict

2020-01-28 Thread Robby Findler
You can cc-superimpose with a blank pict (perhaps that you get via
ghost/launder). Does that help?

Robby

On Tue, Jan 28, 2020 at 2:39 PM Hendrik Boom  wrote:

> Isn't there something like pin-over and pin-under which extends the
> bounding
> box to contain both the 'base' and the pict being written over ot
> under it?
>
> The version with dx and dy would be fine for me, especially if dx and/or
> dy can be negative.
>
> -- 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/20200128203855.igwnxy36a6iontjc%40topoi.pooq.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/CAL3TdOP3%3DOyC6D9QbrL1KpdXW4PEBwwyCr3xiNN1tZnnTY9PCg%40mail.gmail.com.


Re: [racket-users] Annoying run-warnings in DrR 7.5: How to disable?

2020-01-24 Thread Robby Findler
In the preferences dialog, in the General tab, the last checkbox is
the one you want.

But let me confirm: the reason it is painful to turn on the preference
is that you have to choose a file? Would it work well for you if it
only wanted to save files that already had filenames?

Robby

On Fri, Jan 24, 2020 at 2:26 PM Jordan Johnson  wrote:
>
> Hi all,
>
> One thing I’ve noticed is new in DrRacket 7.5 is the warning dialog that pops 
> up upon hitting Run, saying
> “The file  is not saved; save it before Run?”
> where  may be in some other tab than the one that has focus.
>
> This is annoying the heck out of me, as I usually tend to have at least one 
> tab open that’s just for doing little experiments that aren’t worth saving. I 
> can’t seem to find any relevant preference settings.
>
> How do I disable these warnings?
>
> Thanks,
> Jordan
>
> --
> 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/0A128CFA-BA1B-41AD-A9AB-843328DE267D%40fellowhuman.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/CAL3TdOPt4%2BeOjoKWwcbCq0sZswwkXHok6mVxL2NzKTLFQAT50A%40mail.gmail.com.


Re: [racket-users] DrRacket Dark Mode in Windows

2020-01-17 Thread Robby Findler
Which operating system do you use? And can you share a a screenshot?

Robby

On Thu, Jan 16, 2020 at 10:13 PM Juan Carlos Olivo 
wrote:

> "As I understand, you have no problem with the customization for editors,
> but have a problem with the customization for the general UI. Is that
> correct?"
>
> You are correct. Currently I have the editor with a dark theme
> (Spacemacs), but the DrRacket UI itself is light, even though I set it to
> "Dark" in Windows settings.
>
> Thank you for seeking clarification!
>
> --JCO
>
> On Wednesday, January 15, 2020 at 11:59:51 PM UTC-6, Sorawee
> Porncharoenwase wrote:
>>
>> I was reading in the release notes that DrRacket supports dark mode as of
>>> 7.5; however, I don't see this option in the DrRacket preferences. I also
>>> have "Dark" as the default color under the "Colors" section in Settings >
>>> Personalization > Colors. I am using the latest Windows 10.
>>
>>
>> Just to be clear. DrRacket supports theme customization *for the editor*
>> under the "Colors" tab long ago (and this is what Robby was talking about
>> in the above reply). If you want the editor to have a dark background, you
>> should choose "white on black" theme, "Tol's White on Black" theme, or
>> install any additional theme (e.g., Spacemacs Dark) via the package manager.
>>
>> And then there's DrRacket's general UI. Its dark theme support was added
>> since Racket 7.5, and this depends on the customization at the OS level.
>>
>> Here are four possibilities:
>>
>> - Dark theme at the OS level and dark theme for the editor
>>
>> [image: Screen Shot 2020-01-15 at 21.37.05.png]
>>
>> - Dark theme at the OS level and light theme for the editor
>>
>> [image: Screen Shot 2020-01-15 at 21.45.54.png]
>>
>> - Light theme at the OS level and light theme for the editor
>>
>> [image: Screen Shot 2020-01-15 at 21.50.02.png]
>>
>> - Light theme at the OS level and dark theme for the editor
>>
>> [image: Screen Shot 2020-01-15 at 21.49.17.png]
>>
>> As I understand, you have no problem with the customization for editors,
>> but have a problem with the customization for the general UI. Is that
>> correct? I don't have Windows or Linux, so I don't know how DrRacket's
>> general UI looks like for them. But it works reasonably well in MacOS.
>>
>> On Wed, Jan 15, 2020 at 9:03 PM Hendrik Boom 
>> wrote:
>>
>>> On Wed, Jan 15, 2020 at 10:10:12PM -0600, Robby Findler wrote:
>>> > Dark mode will be a lot better in the next release.
>>>
>>> I hope so.  I use drracket in dark mode on Linux.
>>> The main panels have a proper black background, but some of the framing
>>> has a white background, specifically
>>>   the panel that says File Edit View Language, etc
>>> and
>>>   the panel that says Untitles ... Run Stop
>>> on startup.
>>>
>>> > Probably one thing
>>> > you have to do (in the current release) is open the preferences
>>> > dialog, choose "colors" and then click the "white on black" button.
>>> > The snapshot builds are here if you want to see the improvement since
>>> > the last release: https://snapshot.racket-lang.org/
>>> >
>>> > Rpbby
>>> >
>>>
>>> > >
>>> > > Thank you!
>>> > >
>>> > > --JC
>>> > >
>>> > > --
>>> > > 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...@googlegroups.com.
>>> > > To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/racket-users/e3a39d0a-f629-4179-a668-87e87f2a0118%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...@googlegroups.com.
>>> > To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/racket-users/CAL3TdOOxxtr81Cxw-XCq-HqMLDx2SF7OZnzUpUuXcodUONHwZA%40mail.gmail.com
>>> .
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Gr

Re: [racket-users] DrRacket Dark Mode in Windows

2020-01-16 Thread Robby Findler
If you see something funny, please feel free to send me a screenshot so I
can really get what's going on.

Thanks!

Robby

On Thu, Jan 16, 2020 at 10:25 AM Hendrik Boom 
wrote:

> On Thu, Jan 16, 2020 at 07:14:11AM -0600, Robby Findler wrote:
> > Oh, that part is up to your operating system. Depending on which
> > flavor of linux you can get different plugin-type thingies installed
> > to get dark mode for those bits, I believe. I'm not too familiar with
> > how all that works, but the background of the panels is a place where
> > the WM is deciding what to draw (and telling DrRacket what it does),
> > as opposed to DrRacket deciding what color.
>
> The desktop-provided outer frame is properly dark on my system.
> I will incestigate.
>
> >
> > Unless you're saying that other apps look appropriately dark in their
> > panels and dialog boxes and whatnot, and only DrRacket doesn't?
>
> Other apps that I use generally don't have dark modes.
> >
> > Robby
> >
> > On Wed, Jan 15, 2020 at 11:03 PM Hendrik Boom 
> wrote:
> > >
> > > On Wed, Jan 15, 2020 at 10:10:12PM -0600, Robby Findler wrote:
> > > > Dark mode will be a lot better in the next release.
> > >
> > > I hope so.  I use drracket in dark mode on Linux.
> > > The main panels have a proper black background, but some of the framing
> > > has a white background, specifically
> > >   the panel that says File Edit View Language, etc
> > > and
> > >   the panel that says Untitles ... Run Stop
> > > on startup.
> > >
> > > > Probably one thing
> > > > you have to do (in the current release) is open the preferences
> > > > dialog, choose "colors" and then click the "white on black" button.
> > > > The snapshot builds are here if you want to see the improvement since
> > > > the last release: https://snapshot.racket-lang.org/
> > > >
> > > > Rpbby
> > > >
> > > > On Wed, Jan 15, 2020 at 10:07 PM Juan Carlos Olivo
> > > >  wrote:
> > > > >
> > > > > Hello everyone,
> > > > >
> > > > > I was reading in the release notes that DrRacket supports dark
> mode as of 7.5; however, I don't see this option in the DrRacket
> preferences. I also have "Dark" as the default color under the "Colors"
> section in Settings > Personalization > Colors. I am using the latest
> Windows 10.
> > > > >
> > > > > I was wondering if I am missing something or doing something wrong?
> > > > >
> > > > > Thank you!
> > > > >
> > > > > --JC
> > > > >
> > > > > --
> > > > > 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/e3a39d0a-f629-4179-a668-87e87f2a0118%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/CAL3TdOOxxtr81Cxw-XCq-HqMLDx2SF7OZnzUpUuXcodUONHwZA%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/20200116050330.zwk5h2mghmgq42ce%40topoi.pooq.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/CAL3TdOOnXuazo72aL6mQ-T2vTZWb%2BLr4uo5EH-vNzY8p%3Dqq2OQ%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/20200116162500.e6sfcvm3zzvyc7mq%40topoi.pooq.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/CAL3TdOO7A87Gex1qnYBtKB_XpiAzEDQ9B_NX%2BTZNj3QCyj7P5Q%40mail.gmail.com.


Re: [racket-users] DrRacket Dark Mode in Windows

2020-01-16 Thread Robby Findler
Oh, that part is up to your operating system. Depending on which
flavor of linux you can get different plugin-type thingies installed
to get dark mode for those bits, I believe. I'm not too familiar with
how all that works, but the background of the panels is a place where
the WM is deciding what to draw (and telling DrRacket what it does),
as opposed to DrRacket deciding what color.

Unless you're saying that other apps look appropriately dark in their
panels and dialog boxes and whatnot, and only DrRacket doesn't?

Robby

On Wed, Jan 15, 2020 at 11:03 PM Hendrik Boom  wrote:
>
> On Wed, Jan 15, 2020 at 10:10:12PM -0600, Robby Findler wrote:
> > Dark mode will be a lot better in the next release.
>
> I hope so.  I use drracket in dark mode on Linux.
> The main panels have a proper black background, but some of the framing
> has a white background, specifically
>   the panel that says File Edit View Language, etc
> and
>   the panel that says Untitles ... Run Stop
> on startup.
>
> > Probably one thing
> > you have to do (in the current release) is open the preferences
> > dialog, choose "colors" and then click the "white on black" button.
> > The snapshot builds are here if you want to see the improvement since
> > the last release: https://snapshot.racket-lang.org/
> >
> > Rpbby
> >
> > On Wed, Jan 15, 2020 at 10:07 PM Juan Carlos Olivo
> >  wrote:
> > >
> > > Hello everyone,
> > >
> > > I was reading in the release notes that DrRacket supports dark mode as of 
> > > 7.5; however, I don't see this option in the DrRacket preferences. I also 
> > > have "Dark" as the default color under the "Colors" section in Settings > 
> > > Personalization > Colors. I am using the latest Windows 10.
> > >
> > > I was wondering if I am missing something or doing something wrong?
> > >
> > > Thank you!
> > >
> > > --JC
> > >
> > > --
> > > 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/e3a39d0a-f629-4179-a668-87e87f2a0118%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/CAL3TdOOxxtr81Cxw-XCq-HqMLDx2SF7OZnzUpUuXcodUONHwZA%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/20200116050330.zwk5h2mghmgq42ce%40topoi.pooq.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/CAL3TdOOnXuazo72aL6mQ-T2vTZWb%2BLr4uo5EH-vNzY8p%3Dqq2OQ%40mail.gmail.com.


Re: [racket-users] DrRacket Dark Mode in Windows

2020-01-15 Thread Robby Findler
Dark mode will be a lot better in the next release. Probably one thing
you have to do (in the current release) is open the preferences
dialog, choose "colors" and then click the "white on black" button.
The snapshot builds are here if you want to see the improvement since
the last release: https://snapshot.racket-lang.org/

Rpbby

On Wed, Jan 15, 2020 at 10:07 PM Juan Carlos Olivo
 wrote:
>
> Hello everyone,
>
> I was reading in the release notes that DrRacket supports dark mode as of 
> 7.5; however, I don't see this option in the DrRacket preferences. I also 
> have "Dark" as the default color under the "Colors" section in Settings > 
> Personalization > Colors. I am using the latest Windows 10.
>
> I was wondering if I am missing something or doing something wrong?
>
> Thank you!
>
> --JC
>
> --
> 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/e3a39d0a-f629-4179-a668-87e87f2a0118%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/CAL3TdOOxxtr81Cxw-XCq-HqMLDx2SF7OZnzUpUuXcodUONHwZA%40mail.gmail.com.


Re: [racket-users] POPLmark Retrospective Panel at POPL: Come, and send us your questions!

2020-01-08 Thread Robby Findler
Hi folks: for those of you who appreciate tools like Redex, your
thoughts (in the form of questions or in participation on the day) are
most welcome.

Robby

On Tue, Jan 7, 2020 at 1:54 PM Talia Ringer  wrote:
>
> Hi all,
>
>
> As many of you book your tickets to New Orleans for POPL, I’d like to 
> encourage you to be there on Tuesday, January 21st (the day before POPL, or 
> the last day of CPP) for the POPLmark 15 Year Retrospective Panel. This panel 
> will take a look back at the influential POPLmark Challenge for mechanized 
> metatheory 15 years later, with an eye toward the future. It should be an 
> exciting panel for anyone who is interested in proof assistants, mechanized 
> metatheory, and in benchmark suites and challenges to help the POPL community 
> more broadly. .
>
>
> We have some stellar panelists:
>
>
> Benjamin Pierce (Penn)
>
> Peter Sewell (Cambridge)
>
> Xavier Leroy (Collège de France)
>
> Robby Findler (Northwestern)
>
> Scott Owens (Kent)
>
> Brigitte Pientka (McGill)
>
>
> We want to make sure this is a fun and engaging panel, so if you have 
> anything you’d like to hear the panelists discuss, we’d love your questions 
> ahead of time (we’ll of course also take questions in person at the panel). 
> You can send questions using this form. No need to shy away from controversy 
> (we have a great moderator), and don’t worry if you aren’t sure if your 
> question is worth asking. Just send us anything you’d like to hear about 
> related to the POPLmark challenge, mechanized metatheory, and benchmark 
> suites and challenges.
>
>
> Here are just a few examples of what we hope to discuss:
>
>
> What did we learn about different proof assistants and different binding 
> styles from the challenge itself?
>
> What happened in the years immediately following the POPLmark challenge?
>
> What about POPLmark led to its impact? What can we learn from that in 
> designing future benchmark suites for mechanized metatheory, and for 
> programming languages in general?
>
> What has changed since 2005, and what new challenges has this brought with it?
>
> What problems raised in POPLmark were underaddressed? How can we address them?
>
> This is completely free if you’re registered for POPL—no need to sign up 
> separately! Just show up on January 21st. Hopefully see you there!
>
>
> Talia Ringer (UW)
>
> http://tlringer.github.io/
>
> --
> 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/852e3d38-8519-4321-adc3-42cef4d612e5%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/CAL3TdOOC8rOod02xBWmpANxzxAKUm11z8dwQ04sC6-MS3pTgbA%40mail.gmail.com.


Re: [racket-users] Re: macOS 10.10 Yosemite?

2020-01-07 Thread Robby Findler
On Tue, Jan 7, 2020 at 6:10 AM Hendrik Boom  wrote:
>
> On Sat, Jan 04, 2020 at 03:04:32PM -0600, Robby Findler wrote:
> > No Yosemite users to be found?
>
> I seem to have inherited my wife's Mac, and am thinking of trying it out.
> I haave no idea how to use a Mac, the scrolling works in the opposite
> direction to what I'm used to and I can't get to the introductory help
> page by some kind of permission constraint.  I can get to a Unix shell.
>
> How can I find out if it's running Yosemite?

>From the apple menu in the upper right, select "about this mac". The
resulting window should say which version of the OS you have. But
perhaps James's analysis suggests it is unlikely to report 10.10.

Robby

-- 
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/CAL3TdOP8kRKXRWUuH7nYMS-ub%2BTY-2YBxMwQN1W1oJPsZamTQA%40mail.gmail.com.


Re: [racket-users] Confused about Semantics Engineering Exercise 12.6

2020-01-04 Thread Robby Findler
Thanks, Mike. I (finally) updated the errata page.

Robby

On Sat, Nov 30, 2019 at 3:24 PM Mike MacHenry  wrote:
>
> Also this is a *very* minor point, but I'm pretty sure exercise 13.2 should 
> read "Compare with the full grammar from exercise 12.2." rather than to 
> compare with 12.1. Maybe not worthy even of the errata page. I don't know. 
> But if you're going to reprint ever it'd be nice to flag for clean up.
>
> On Sat, Nov 30, 2019 at 3:45 PM Mike MacHenry  wrote:
>>
>> Hm... so I guess I'm "using a with clause" like the book requests if I'm 
>> redeveloping the iswim-general reduction relation myself, even if the only 
>> difference from the book's version is to name it general and to make it 
>> reference the new iswim language I made that has the compatible closure 
>> context instead of the evaluation context. This makes more sense, thanks. It 
>> felt like I must have misunderstood because what I did, which was the 
>> quickest and easiest way to do this, was to change my original language 
>> definition, rather than make a new one and thus need to make a new reduction 
>> using a with clause.
>>
>> -mike
>>
>> On Sat, Nov 30, 2019 at 11:17 AM Robby Findler  
>> wrote:
>>>
>>> Hi Mike: it looks to me like you have the right definition in the
>>> sense that it relates the right terms to each other. The rest of the
>>> exercise is just to get you to use Redex's `with` to express it and to
>>> avoid using the name `E` for a non-evaluation context. These are very
>>> minor things! What's being asked is that you use the name `C` for the
>>> compatible closure context (not change `E` like you've done) and then
>>> use `with` in the reduction relation definition to lift the axioms to
>>> arbitrary contexts. You would also not call this new (racket-level)
>>> definition `iswim-standard` (since it isn't the standard reduction).
>>>
>>> Robby
>>>
>>> On Fri, Nov 29, 2019 at 12:47 PM Mike MacHenry  
>>> wrote:
>>> >
>>> > Hey everyone,
>>> >
>>> > I am a little confused about Exercise 12.6 from Semantics Engineering 
>>> > with PLT-Redex. The exercise is as follows:
>>> >
>>> > "Formulate a general reduction relation for ISWIM using a with clause. 
>>> > Use traces to demonstrate that programs may be reduced to values along 
>>> > several different paths in a reduction graph. "
>>> >
>>> > The problem I'm having with this is that to accomplish this goal, I 
>>> > needed to make a change to the ISWIM language definition on page 217 at 
>>> > the beginning of this chapter, particularly in the contexts section, and 
>>> > I made absolutely no change to the reduction relation given on page 225 
>>> > directly above this exercise.
>>> >
>>> > So for me, that language definition from 217, along with the reduction 
>>> > relation on 225, as well as the definitions for the meta functions in 
>>> > this chapter, I get the standard reduction, which permits only one 
>>> > reduction path for, say, an expression like (+ (1 1) (+ 1 1)). The 
>>> > left-most (+ 1 1) reduces to 2 first.
>>> >
>>> > When I make the change to the contexts in the language definition, and 
>>> > change it from
>>> >
>>> > (E hole (V E) (E M) (o V ... E M ...))
>>> >
>>> > to
>>> >
>>> > (E hole (M E) (E M) (o M ... E M ...))
>>> >
>>> > My traces for the above expression gives what I think the exercise is 
>>> > expecting. I have a diamond shaped in my reduction DAG.
>>> >
>>> > The problem I have with this is that I haven't done anything to the 
>>> > reduction relation to do this. The exercise seems pretty explicit to 
>>> > create a reduction relation using a with clause. so it seems like the 
>>> > purpose of the exercise is to get you to understand the with clause by 
>>> > developing something new using it. Now granted my reduction relation does 
>>> > use a with clause, because it's the one I copied out of the book. But I 
>>> > didn't write that one and use the with clause in my own new way.
>>> >
>>> > So is there a different way to get the reduction relation to support the 
>>> > general reduction that requires one to change the reduction relation and 
>>> > not the grammar?
>>> >
>>> > Thanks for t

[racket-users] Re: macOS 10.10 Yosemite?

2020-01-04 Thread Robby Findler
No Yosemite users to be found?

Robby

On Mon, Dec 23, 2019 at 8:36 AM Robby Findler  wrote:
>
> We recently changed a library that DrRacket uses on macOS 10.10 and
> later, but have only a 10.11 version to test on. Does someone have
> version 10.10 running that they can download the current Utah snapshot
> build and report if DrRacket starts properly and if tabs seem to work
> properly (creating a new tab (cmd-t), switching between tabs)?
>
> This is the place to download it: https://www.cs.utah.edu/plt/snapshots/
>
> Thanks!
>
> Robby

-- 
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/CAL3TdOPHCpNhqo_rgrKmy8SqszDdkBXAzba-uqFTRsPZrW%2BMAg%40mail.gmail.com.


[racket-users] macOS 10.10 Yosemite?

2019-12-23 Thread Robby Findler
We recently changed a library that DrRacket uses on macOS 10.10 and
later, but have only a 10.11 version to test on. Does someone have
version 10.10 running that they can download the current Utah snapshot
build and report if DrRacket starts properly and if tabs seem to work
properly (creating a new tab (cmd-t), switching between tabs)?

This is the place to download it: https://www.cs.utah.edu/plt/snapshots/

Thanks!

Robby

-- 
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/CAL3TdOP2dY_GqY_Rrz9pwqLB%3DkfyHjTHLr3G9%3D0q9nnRtLiARA%40mail.gmail.com.


Re: [racket-users] pict polygons

2019-12-17 Thread Robby Findler
2htdp/image images should work where Picts work (ie they are pict
convertible).

Robby

On Tue, Dec 17, 2019 at 8:15 AM Hendrik Boom  wrote:

> I've been looking through pict documentation again, and failed to find
> a way to draw arbitrary polygons.
>
> (at the moment I just want a triangle, but I couldn't even find
> that)
>
> There are triangles in the image.rkt from 2htdp/image, but that seems to
> use
> different data types from pict.
>
> Given the variety of polygons available in pict (such as filled-in
> areas) I would find it surprising if there were no such functionality,
>
> -- 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/20191217141452.g27usl46rwn556re%40topoi.pooq.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/CAL3TdOMK1QhYXgYv78Zr-4YWu%2BE%3DeLTCqkDWxubOBsJSeePAVw%40mail.gmail.com.


Re: [racket-users] Re: racket-mode in emacs and error navigation

2019-12-12 Thread Robby Findler
Error trace is what DrRacket is using under the hood too.

Robby

On Thu, Dec 12, 2019 at 1:15 PM Nathaniel Griswold 
wrote:

> I have discovered that if i do a C-u C-c C-c i get better error messages
> and can navigate to the proper spot. It uses something called errortrace.
> So i guess this is a non-issue.
>
> On Thursday, December 12, 2019 at 12:53:55 PM UTC-6, Nathaniel Griswold
> wrote:
>>
>> Hello. I really like DrRacket's error output but i have recently switched
>> to emacs as i prefer its parenthesis navigation modes and other things
>> about it.
>>
>> One thing i noticed is when i have an error, say application with wrong
>> number of args, if i navigate to error using "C-x `" i don't skip to the
>> part where the application went wrong.
>>
>> It is a bit annoying and DrRacket is way better in this scenario. Does
>> anyone have a way of making this work nicely in emacs racket-mode?
>>
>> Thank you.
>>
> --
> 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/eefda544-5a9f-438b-93bc-855b53f76bcf%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/CAL3TdOPqAwGGDwPUeYtzu9uWXW0dpLbUEuF0%3DudhEYM8u5L_GQ%40mail.gmail.com.


Re: [racket-users] DrRacket 7.5 colors a bit dark and low contrast on Mac

2019-12-06 Thread Robby Findler
Okay, Sorawee and I had a side-bar conversation and I've pushed a fix.
Thanks for alerting me to the problem!

(The DrRacket-level preferences don't default to the right color scheme
when the OS is in dark mode currently either, but maybe I'll have to fix
that one another day.)

Robby

On Fri, Dec 6, 2019 at 2:30 PM Robby Findler 
wrote:

> Can you folks send me your preference file (off list)? Feel free to redact
> it however you want.
>
> Robby
>
> On Fri, Dec 6, 2019 at 1:29 PM Sorawee Porncharoenwase <
> sorawee.pw...@gmail.com> wrote:
>
>> Confirm that I have this problem as well, even when I reset all
>> preference files.
>>
>> On Fri, Dec 6, 2019 at 11:17 AM Daniel Prager 
>> wrote:
>>
>>> Hi Robby
>>>
>>> > What happens if you open the preferences dialog and turn
>>> white-on-Black on and back off again?
>>>
>>> No change.
>>>
>>> I still have 7.2 on my system, which works fine.
>>>
>>> Here's what it looks like in black-on-white for reference.
>>>
>>> [image: image.png]
>>>
>>>>
>>>>> --
>>> 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/CAFKxZVWwkztEadAFEruizXZ%3DJ3pHyK7Kd%2BpU0UBzqo95Sdr%2B4A%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/racket-users/CAFKxZVWwkztEadAFEruizXZ%3DJ3pHyK7Kd%2BpU0UBzqo95Sdr%2B4A%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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/CADcuegsoMSqnzCZG9uRy2Sv%2BOzsfcP0%3DyAVxnyzQ0ndqJ5DP4w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CADcuegsoMSqnzCZG9uRy2Sv%2BOzsfcP0%3DyAVxnyzQ0ndqJ5DP4w%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

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


Re: [racket-users] DrRacket 7.5 colors a bit dark and low contrast on Mac

2019-12-06 Thread Robby Findler
Can you folks send me your preference file (off list)? Feel free to redact
it however you want.

Robby

On Fri, Dec 6, 2019 at 1:29 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> Confirm that I have this problem as well, even when I reset all preference
> files.
>
> On Fri, Dec 6, 2019 at 11:17 AM Daniel Prager 
> wrote:
>
>> Hi Robby
>>
>> > What happens if you open the preferences dialog and turn white-on-Black
>> on and back off again?
>>
>> No change.
>>
>> I still have 7.2 on my system, which works fine.
>>
>> Here's what it looks like in black-on-white for reference.
>>
>> [image: image.png]
>>
>>>
 --
>> 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/CAFKxZVWwkztEadAFEruizXZ%3DJ3pHyK7Kd%2BpU0UBzqo95Sdr%2B4A%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/CADcuegsoMSqnzCZG9uRy2Sv%2BOzsfcP0%3DyAVxnyzQ0ndqJ5DP4w%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/CAL3TdONix7f_wzgrqpLUbmK1EF2-mXP9P%2BFXZ-DLkqz%3D1fknjg%40mail.gmail.com.


Re: [racket-users] Confused about Semantics Engineering Exercise 12.6

2019-11-30 Thread Robby Findler
Hi Mike: it looks to me like you have the right definition in the
sense that it relates the right terms to each other. The rest of the
exercise is just to get you to use Redex's `with` to express it and to
avoid using the name `E` for a non-evaluation context. These are very
minor things! What's being asked is that you use the name `C` for the
compatible closure context (not change `E` like you've done) and then
use `with` in the reduction relation definition to lift the axioms to
arbitrary contexts. You would also not call this new (racket-level)
definition `iswim-standard` (since it isn't the standard reduction).

Robby

On Fri, Nov 29, 2019 at 12:47 PM Mike MacHenry  wrote:
>
> Hey everyone,
>
> I am a little confused about Exercise 12.6 from Semantics Engineering with 
> PLT-Redex. The exercise is as follows:
>
> "Formulate a general reduction relation for ISWIM using a with clause. Use 
> traces to demonstrate that programs may be reduced to values along several 
> different paths in a reduction graph. "
>
> The problem I'm having with this is that to accomplish this goal, I needed to 
> make a change to the ISWIM language definition on page 217 at the beginning 
> of this chapter, particularly in the contexts section, and I made absolutely 
> no change to the reduction relation given on page 225 directly above this 
> exercise.
>
> So for me, that language definition from 217, along with the reduction 
> relation on 225, as well as the definitions for the meta functions in this 
> chapter, I get the standard reduction, which permits only one reduction path 
> for, say, an expression like (+ (1 1) (+ 1 1)). The left-most (+ 1 1) reduces 
> to 2 first.
>
> When I make the change to the contexts in the language definition, and change 
> it from
>
> (E hole (V E) (E M) (o V ... E M ...))
>
> to
>
> (E hole (M E) (E M) (o M ... E M ...))
>
> My traces for the above expression gives what I think the exercise is 
> expecting. I have a diamond shaped in my reduction DAG.
>
> The problem I have with this is that I haven't done anything to the reduction 
> relation to do this. The exercise seems pretty explicit to create a reduction 
> relation using a with clause. so it seems like the purpose of the exercise is 
> to get you to understand the with clause by developing something new using 
> it. Now granted my reduction relation does use a with clause, because it's 
> the one I copied out of the book. But I didn't write that one and use the 
> with clause in my own new way.
>
> So is there a different way to get the reduction relation to support the 
> general reduction that requires one to change the reduction relation and not 
> the grammar?
>
> Thanks for the help,
> -mike
>
> --
> 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/CAAzRdbcM9w9wi-mPzdpY_4tBWSWv_QaXvZDpgNiXSEr05OaMoA%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/CAL3TdOOziqT5365jtknP8N9pJAA-UJiLTVZi12oEXSofGgjkgg%40mail.gmail.com.


Re: [racket-users] reading code

2019-11-11 Thread Robby Findler
On Mon, Nov 11, 2019 at 10:30 AM Hendrik Boom  wrote:
>
> On Fri, Oct 25, 2019 at 11:31:41AM +0200, Niklas Larsson wrote:
> > Hi!
> >
> > If you right click on an identifier in drracket you get “jump to binding 
> > occurrence” and “jump to definition” (if it’s defined in another file). 
> > Don’t those do what you want?
>
> Close.
>
> Using "jump to binding occurrence" gets me to the require
> line that provides me the symbol.  I can then ask it to open
> that file, but if the other file just imports a number of other
> modules and provides all-from-out it still leaves me a bit lost.
>
> I turn out not to have "jump to definition" but
> "open defining file", which creates a new tab.  Then I still
> have to search for the name I was looking for.  But at least
>  can find it.

That menu item will become "jump to definition" if the file is already
open in another tab (and check syntax has had time to analyze that
tab's content).

Robby

-- 
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/CAL3TdOPYu3cxJ8jm%3DCgMKso37wSS54A0a6KjdpuX9XJ%3DN-pseg%40mail.gmail.com.


Re: [racket-users] Modeling a context-sensitive evaluation context with PLT Redex?

2019-11-09 Thread Robby Findler
I am not sure how the details work out but I guess Jay's advice of writing
a judgement form that shows how terms reduce is the right thing (and that
judgment form may or may not use context decomposition patterns).

Robby

On Sat, Nov 9, 2019 at 6:31 AM Alexis King  wrote:

> Hi Jay,
>
> I appreciate your pointers! However, I think either I didn’t make my
> question clear enough, or I misunderstand your explanation (or perhaps some
> of both).
>
> What I am trying to model is, indeed, a form of delimited control. I have
> already written a model that supports a couple classic control operators,
> namely exception handling and nondeterminism, plus some of the simpler
> algebraic operations from the algebraic effects literature such as mutable
> state. However, this isn’t quite sufficient for what I’m trying to do, as
> effect systems allow the programmer to define those kinds of control
> operators using more general primitives in the host language.
>
> Here’s an example of what an effect definition and an effect handler might
> look like in a hypothetical language that supports algebraic effect
> handlers:
>
>   effect Error e where
> throw :: e -> a
>
>   handleError :: (() ->{Error e} a) -> Either e a
>   handleError f =
> handle Error where
>   throw e _k = Left e
> in Right (f ())
>
> You can reasonably think of `effect` and `handle` in terms of delimited
> control. Each `effect` declaration declares a new prompt tag, and each
> operation of the effect aborts, passing its current continuation to the
> prompt handler. Likewise, each `handle` declaration installs a new prompt
> with the appropriate tag and handler. (In the above example, `throw`
> discards the continuation and simply returns.)
>
> This interpretation works well enough for algebraic effects, but this
> makes it impossible to support operations like `catch`, or `cut` (for some
> kind of backtracking effect) forcing them to be handlers instead. This
> turns out to cause trouble in practice., so some newer work handles
> so-called “scoped” effects as well, which support “scoping” operations like
> `catch` and `cut`. I have been working on an implementation of a scoped
> effect system in Haskell, but I have found many edge cases where the
> behavior of current systems produces nonsensical results given certain
> handler compositions.
>
> Fortunately, I have found that it is possible to produce a significantly
> more predictable semantics for scoped effect handlers by viewing them as
> kind of like “first class reduction rules.” A handler for an Error effect
> supporting both `throw` and `catch` can be expressed using the following
> three reduction rules:
>
> E[handleError v] -> E[Right v]
> E_1[handleError E_2[throw v]] -> E_1[Left v]
> E_1[handleError E_2[catch e v]] ->
>   E_1[handleError E_2[
> case handleError e of
>   Right a -> a
>   Left  b -> v b]]
>
> However, doing this also requires extending the definition of E itself so
> that reduction may proceed into the appropriate locations:
>
> E ::= ... | throw E | catch e E | handleError E
>
> Therefore, this encoding of scoped handlers requires that they operate at
> the level of the metalanguage, which is not enough — I want to come up with
> a model that pushes the above expressive power into the language by
> defining appropriately general-purpose `effect` and `handler` syntactic
> forms.
>
> It is possible that what you are telling me is I should not bother, and
> instead I should try to define a translation from my higher-level language
> into something simpler to actually implement, such as some well-known model
> of delimited control. However, the reason I have been hoping to avoid doing
> that is I think the translation is not as straightforward as it seems, and
> the main reason I want to model the higher-level interface directly is to
> better understand how I think it ought to work before I try and define a
> translation into something else (probably delimited continuations or
> monads).
>
> Does that help to give a little more context? I was trying not to drag too
> much of it in when writing my original email, but it’s possible that in
> doing so I omitted too much. :)
>
> Alexis
>
> > On Nov 9, 2019, at 04:53, Jay McCarthy  wrote:
> >
> > First, any inductive definition could be defined with
> > `define-judgment-form` (although derivations will only be discoverable
> > if you can give a mode spec.) If the semantics you're talking about
> > can't be written as an inductive definition, then it probably doesn't
> > make any sense.
> >
> > Second, remember that an evaluation context is just a way of
> > describing more succinctly what you could otherwise define by hand as
> > a big, complicated relation on individual terms. (The beginning of
> > SEwPR explains this very well.) I feel like you'll get something from
> > thinking about existing semantics that structure the context in
> > different ways. For example, in 

Re: [racket-users] transparency in Pict

2019-09-10 Thread Robby Findler
Another trick I use is to crop the picture that is nominally below the
image and then just draw it again, but this time on top.

Robby

On Mon, Sep 9, 2019 at 2:15 PM Jens Axel Søgaard 
wrote:

> You can use a path with an even-odd-fill to cut out parts.
>
> An example:
>
> #lang racket
> (require metapict metapict/polygons)
>
> (define (cutout p x y r)
>   (defv (w h) (pict-size p))
>   (with-window (window 0 w 0 h)
> (brushstipple (pict->bitmap p)
>   (eofill (rectangle (pt 0 0) (pt w h))
>   (circle x y r)
>
> (set-curve-pict-size 400 400)
> (def p (brushcolor "red" (fill (regular-polygon 5
> (cutout p 200 200 50)
>
> /Jens Axel
>
> The result (the yellowish color is the background color in my editor):
>
> [image: image.png]
>
>
> Den man. 9. sep. 2019 kl. 20.20 skrev Hendrik Boom  >:
>
>> I'm wondering how to cut a transparent hole in something.
>>
>> Say I have a rectangle and I want to make part of it transparent so
>> that I cn see what's behind it.
>> Drawing a transparent rectangle on top of it won't workm because it'll
>> just reveal the original rectangle.
>> The only way I cn see it to draw the original rectangle in pieces,
>> careful avoiding the area I want to make transparent.  (that may be
>> tricky if the transparent area is, say, a circle).
>>
>> Is there some convenient operation in Pict that can accomplish this
>> more directly?  Kind of the union and intersection and complementation
>> on constructive solid geometry, but now 2D.
>>
>> My guess is no.  I haven't found it.  So I ask.
>>
>> Maybe I'll need some other drawing tool than Pict.  Suggestions welcome.
>>
>> -- 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/20190909182018.74o322qfwehrmqaz%40topoi.pooq.com
>> .
>>
>
>
> --
> --
> Jens Axel Søgaard
>
> --
> 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/CABefVgy0cxZD1dJv6dA51_rTEFqk3wu-zBSpGdQV-eD1fmurag%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/CAL3TdOMM1rPLCGyicrcEv50USDaHmtOs-hPo4r%2BaKCACAgJw%3Dw%40mail.gmail.com.


Re: [racket-users] Embedding a map widget in the DrRacket REPL

2019-09-06 Thread Robby Findler
Wow, thank you!

Robby

On Thu, Sep 5, 2019 at 11:00 PM Alex Harsanyi 
wrote:

>
>
> On Wednesday, September 4, 2019 at 7:50:19 PM UTC+8, Stephen De Gabrielle
> wrote:
>>
>> Dr Racket is amazing. Need to a demo of this and plot side by side.
>>
>
> I can do better than just put a plot and a map widget side by side:
> https://youtu.be/R2KU0ZvIJws
>
> Alex.
>
>
>>
>> DrRacket is so close to being an electronic lab notebook it’s almost
>> painful
>>
>> Stephen
>>
>> On Wed, 4 Sep 2019 at 12:20, Sage Gerard  wrote:
>>
>>> How cool is that! DrRacket's flexibility is pretty amazing
>>>
>>>
>>>
>>>  Original Message 
>>> On Sep 4, 2019, 5:41 AM, Alex Harsanyi < alexha...@gmail.com> wrote:
>>>
>>>
>>>
>>> As part of another project, I had to update my map-widget to act as a
>>> snip% so it can be inserted into a pasteboard%.   An unintended side
>>> benefit of this work is that maps can now be embedded in the DrRacket REPL
>>> -- this in itself is not very useful, but it does make for a cool demo, so
>>> I thought I would record a video of it and share it here:
>>> https://youtu.be/MrS0FG-X8DI
>>>
>>> Here is a screenshot too:
>>>
>>> [image: map-snip-demo.PNG]
>>>
>>>
>>> For those who want to try it out, you can install the map-widget
>>> package, than type the following in the REPL:
>>>
>>> (require map-widget)
>>> (new map-snip%)
>>>
>>> Note that map tile download is not very fast, but the code does cache
>>> all downloaded data locally, this means that once tiles are downloaded,
>>> subsequent runs which show the same area will be fast.  In the linked video
>>> you don't see any tiles being loaded, as I did a practice run before
>>> recording it and all map data was locally available, making it load
>>> instantly -- you can do that too if you run the code a second time.
>>>
>>> And in case you want to have a look at the code itself, it is here:
>>> https://github.com/alex-hhh/map-widget
>>>
>>> Enjoy,
>>> Alex.
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/racket-users/fdc50657-4125-4c2f-b0a9-03bc701fe869%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...@googlegroups.com.
>>>
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/racket-users/IyQJpx7V3hwBoRhSKLdOfYxktKfIFtpP0_Wl5_be2mPSg6RIUSJQMQHR6tTBL6qr0FbY210RV2u9ksNrj1vbh_KS3Dh9GguXONj-slVw75s%3D%40sagegerard.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/c23a6d78-1a59-4a77-9d0d-bcbcef1c27a9%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/CAL3TdOPe8bV6s_1mCrORZ3ufWzcGs%3DgfmqZBt7kok3qWcNExcw%40mail.gmail.com.


Re: [racket-users] Pict combiners in list form?

2019-09-05 Thread Robby Findler
Although this is a bit tedious and I write that too much too ... maybe they
should call "flatten" on their arguments or just accept a list of picts?

Robby

On Wed, Sep 4, 2019 at 10:16 PM David Thrane Christiansen <
da...@davidchristiansen.dk> wrote:

> Hi Hendrik,
>
> I use apply for that.  Eg (apply hbl-append (pict-width (t " "))
> my-list-of-picts).
>
> David
>
> On Wed, Sep 4, 2019, 20:06 Hendrik Boom  wrote:
>
>> Is there a way to call the pict combiners (such as ht-append) giving it a
>> list of argument picts instead of a varying number of argument picts?
>>
>> Perhaps another set of append functions, or another way of calling
>> functions
>> in Racket?  I find myself writing list-folowing recursions every time I
>> want
>> this.
>>
>> -- 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/20190905030628.rg4uoaac3zro7ztr%40topoi.pooq.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/CAF_itEs8niKiFSvwfoxYs%3D_o-DEa0Etmph_zL_jren0CqzLSFA%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/CAL3TdONXAk9r95T-4Byv9pc9%3DRtBy35df-anqQvJOn8B6YO8aA%40mail.gmail.com.


Re: [racket-users] Borders in pict

2019-09-03 Thread Robby Findler
These change the pen width and I believe the pen sits right on the border
of the rectangle. As Ben points out, they don't affect the width and height
of the pict, but picts draw outside their bounding box sometimes.

Robby

On Mon, Sep 2, 2019 at 9:22 PM Ben Greenman 
wrote:

> Inside
>
> Welcome to Racket v7.4.0.1.
> > (require pict)
> > (pict-width (rectangle 100 100 #:border-width 5))
> 100
> > (pict-height (rectangle 100 100 #:border-width 5))
> 100
>
> --
> 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/CAFUu9R5ngc%2BUdL_pPCLARkO2ZDeXq6CPXMrYZpiAgJ1RgstoqQ%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/CAL3TdONazUTfOL4bhGRjxa2DpaQ7Lz2EygXx9Mygaa%2BK%2B8Coeg%40mail.gmail.com.


Re: [racket-users] Is there an expanded form of the Racket2 purpose declaration?

2019-08-28 Thread Robby Findler
On Wed, Aug 28, 2019 at 1:44 PM Breck Yunits  wrote:
>
> > I'm not sure this was clear, but I think the clear goal for backwards 
> > compatibility is that code that used to run continues to run indefinitely. 
> > With no changes. That's certainly what the Racket core developers mean by 
> > "backwards compatible".  In other words "requiring porting" is the opposite 
> > of "backwards compatible", at least in my mind.
>
> I get this, but I think it's a strategic mistake. I think the goal should be 
> to move people forward to the new versions (whenever they come out) as 
> quickly as possible (think Apple and the rapid adoption of new iOS versions, 
> compared to Microsoft). NEVER break people's stuff, but make it dead simple 
> for them to upgrade to the new stuff, by changing their code for them. I 
> think the success of Apple has proved this is the better long-term strategy.
>
> If Racket's truly a Language Oriented Programming language, than parsing it 
> and upgrading it should be dead simple. Otherwise, why would I want to use a 
> language that's difficult to upgrade?

I'm not sure I agree with this position, at least in the strong sense
it is written here.

In my opinion, it is essential that a good programming environment (by
that I mean the language, libraries, community, IDE, the whole ball of
wax) should support what the programmer needs -- that's the primary
goal. Things like making people move forward to new versions are good
for the developers of the language (eg, less to maintain etc) but a
programmer has needs that are often driven by their bottom line and if
the programming language/environment gets in the way of that decision,
programmers will stop using it ... in the worst case as they run out
of income because they're busy satisfying things other than their
bottom line.

Of course, it is good to make it easy to move to new versions of the
language, but if there is no real benefit to the transition for the
programmer (eg they aren't planning to touch that code for the next N
months anyway as it does its job well) then I think we should let them
leave it alone and come to it when they need to.

Robby

-- 
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/CAL3TdOMR%3D4kHDxUkwPyJc%2BeXWrg08DPfQz%2BAYLsh%3DwNTVxz9JQ%40mail.gmail.com.


Re: [racket-users] Is there an expanded form of the Racket2 purpose declaration?

2019-08-28 Thread Robby Findler
I'm not sure this was clear, but I think the clear goal for backwards
compatibility is that code that used to run continues to run
indefinitely. With no changes. That's certainly what the Racket core
developers mean by "backwards compatible".  In other words "requiring
porting" is the opposite of "backwards compatible", at least in my
mind.

Robby

On Wed, Aug 28, 2019 at 11:33 AM Breck Yunits  wrote:
>
> I'd recommend investing work to make the problem of porting Racket1 code to 
> RacketN painless. Hopefully as simple as one method call.
>
> If translating Racket1 code to RacketX is made an easy problem, then you can 
> do what is best for RacketX without worrying about how backwards 
> compatibility.
>
> That would pay dividends in other areas as well, regardless of what direction 
> Racket2 goes in.
>
>
> On Wed, Aug 28, 2019 at 6:28 AM Jay McCarthy  wrote:
>>
>> My thoughts are in the thread you linked to:
>>
>> https://github.com/racket/racket2-rfcs/issues/105#issuecomment-521446706
>> """
>> I see Racket2 through the rubric of "We almost never break backwards
>> compatible and insist on gradual evolution as the only way to make
>> progress; but, now we are willing to make some radical changes: What
>> can we do to make Racket drastically better that can't be expressed as
>> an evolution?" In other words, I feel like Racket2 is defined as the
>> goal, "Whatever makes Racket a lot better" and the design constraint,
>> "It's okay to be incompatible."
>> """
>>
>> When it comes specifically to syntax, which is what you seem to be
>> asking about by reading the quote, here's a quote from my attempts to
>> write this up before:
>>
>> https://github.com/racket/racket2-rfcs/pull/109/files#diff-f609e36bab3cb71c8829f58a5f9b2455R16
>> """
>> The uniformity of S-expressions limits the amount of information at
>> the notational level of reading Racket programs. A small amount of
>> extra notation can go a long way with a small number of mores on its
>> use. For example, in Racket brackets are used in S-expressions when no
>> function or macro application is implied (like in the cases of a
>> `cond`); reading Racket programs without this notational affordance is
>> more difficult. On the other hand, it is awkward to embed arbitrary
>> fragments of code not in S-expression format, such as when quoting a
>> program in another language. The only effective option is to embed a
>> string. The Racket @-reader is helpful at this, but it is not
>> uniformly available and the standard structure of Racket's
>> S-expression based languages do not allow macro-specific reading of
>> such syntaxes.
>> """
>>
>> I'll add that I see S-expressions as obviously limited and it would be
>> nice to make a more powerful syntactic extension system that does not
>> say, "You can have anything you want, provided it is a parenthesis."
>>
>> So for me, I don't see the syntax mission as having anything to do
>> with students or getting people to like me, I see it as a way to go
>> beyond the limitations of S-expressions and do something more powerful
>> and interesting. I think people will like us more after in as much as
>> I think people like awesome things, and I want to make something
>> awesome.
>>
>> Jay
>>
>> --
>> Jay McCarthy
>> Associate Professor @ CS @ UMass Lowell
>> http://jeapostrophe.github.io
>> Vincit qui se vincit.
>>
>> On Wed, Aug 28, 2019 at 1:09 AM David Storrs  wrote:
>> >
>> > The discussion on Racket2 seems to have moved offlist to the RFC list on 
>> > github (https://github.com/racket/racket2-rfcs/issues); are there other 
>> > locations?
>> >
>> > There is one question that I had back at the beginning of the process that 
>> > I didn't manage to get clarity on, which is the rationale behind the whole 
>> > thing.  I've gone back through some of the email discussion and gone 
>> > through all 4 pages of the issues lists and read everything that seemed 
>> > relevant.  The most apropos thing seems to be this:  
>> > https://github.com/racket/racket2-rfcs/issues/105 but it still doesn't 
>> > really speak to my question.
>> >
>> > My current understanding is that the rationale for the Racket2 effort 
>> > looks something like this:
>> >
>> > "We, the core developers, many (all?) of whom are also academics with a 
>> > lot of experience teaching Racket to new programmers, have noticed that 
>> > parentheses and prefix notation are a stumbling block for many students.  
>> > We would like to help the ideas of Racket spread into the larger 
>> > community.  Therefore, we want to produce Racket2, which will have all the 
>> > power of Racket but will get rid of parens and use infix notation, which 
>> > will be more familiar and intuitive to students.  We also see this as a 
>> > great time to improve existing elements of the language based on what 
>> > we've learned since they were added, and potentially add new features."
>> >
>> > Is this in fact correct?  Is there more specific discussion of it 
>> > somewhere 

Re: [racket-users] Failed to load module in drracket

2019-08-28 Thread Robby Findler
I think the best path forward probably involves changing DrRacket so
that, on a case-by-case basis, people can opt-in to loading specific
external libraries automatically. I've not yet tried to implement
that, but if someone wants to, the right starting place is the code
that currently disallows the access, which is here:

https://github.com/racket/drracket/blob/5a71d4580d9799a88707eb269879da0635ae97ad/drracket/drracket/private/expanding-place.rkt#L512

There would be changes required to identify that a shared library load
was denied, convey that back to the main place where DrRacket runs,
then add some way to offer people to allow it, which would then set a
preference somehow and the other place could consult that preference
to see what is allowed. Something like that.

I like this idea and hope to get to it eventually, but I can't do it right now.

Robby


On Sat, Aug 24, 2019 at 10:12 PM Hong Yang  wrote:
>
> Hi Robby
>
> Thanks for your explain, is ther any way I can enforce to load the module? or 
> let me know which code did this?
>
> Best reagrds
> Walter

-- 
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/CAL3TdOOW7w8g7db6HjWh0yCBN5WaD5Js0Px7nW%2BUt28miswU5A%40mail.gmail.com.


Re: [racket-users] Failed to load module in drracket

2019-08-24 Thread Robby Findler
DrRacket expands your program in a mode that is relatively constrained, not
allowing it certain access to the file system or allowing it to run
executables or make network connections or lots of other things. This is
because it starts running code (on your behalf) as soon as it opens the
file in the editor and it would be bad if you accidentally opened nefarious
code and it got to run right away without you looking at it.

Robby

On Sat, Aug 24, 2019 at 10:14 AM Hong Yang  wrote:

> me too of to maillist..:(
>
> Hong Yang  于 2019年8月24日周六 下午11:04写道:
>
>> Hi Robby
>>
>> The error message just apear after I type (require fluxus/fluxus) in the
>> drracket. The mentioned so is an extension of racket for fluxus.
>>
>> Thanks
>> Walter
>>
>> Robby Findler  于 2019年8月23日周五 下午7:43写道:
>>
>>> (Sorry, accidentally dropped the list CC.)
>>>
>>> On Fri, Aug 23, 2019 at 6:42 AM Robby Findler 
>>> wrote:
>>>
>>>> Is this an error you see when you click "run" or does it appear along
>>>> the very bottom of the window on its own?
>>>>
>>>> Robby
>>>>
>>>> On Fri, Aug 23, 2019 at 5:23 AM Walter Yang  wrote:
>>>>
>>>>> I'm trying to load a module in drracket:
>>>>>
>>>>> #lang racket
>>>>>
>>>>> (require fluxus/fluxus)
>>>>>
>>>>> I got the following error message:
>>>>>
>>>>>   default-load-extension-handler: forbidden (execute) access to
>>>>> /usr/share/racket/collects/fluxus/compiled/native/x86_64-linux/3m/fluxus-engine_ss.so
>>>>>
>>>>> But it's OK load in command line racket:
>>>>>
>>>>> $ racket
>>>>> Welcome to Racket v7.4.
>>>>> > (require fluxus/fluxus)
>>>>> >
>>>>>
>>>>> Any comments?
>>>>>
>>>>> Thanks
>>>>> Walter
>>>>>
>>>>> --
>>>>> 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/a76162ca-ee89-4d62-be51-e6a81d6adfd3%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/racket-users/a76162ca-ee89-4d62-be51-e6a81d6adfd3%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> --
> 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/CAATsUuUVM91pMAOM9a9n3WJ4NZb0JjMeFk_CwrbyLBNtfL7gUg%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAATsUuUVM91pMAOM9a9n3WJ4NZb0JjMeFk_CwrbyLBNtfL7gUg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAL3TdONovg0inJvDG-1x-%2BObTm%3DwkFAsiNXm0m-pWn3TUCWoGQ%40mail.gmail.com.


Re: [racket-users] Failed to load module in drracket

2019-08-23 Thread Robby Findler
(Sorry, accidentally dropped the list CC.)

On Fri, Aug 23, 2019 at 6:42 AM Robby Findler 
wrote:

> Is this an error you see when you click "run" or does it appear along the
> very bottom of the window on its own?
>
> Robby
>
> On Fri, Aug 23, 2019 at 5:23 AM Walter Yang  wrote:
>
>> I'm trying to load a module in drracket:
>>
>> #lang racket
>>
>> (require fluxus/fluxus)
>>
>> I got the following error message:
>>
>>   default-load-extension-handler: forbidden (execute) access to
>> /usr/share/racket/collects/fluxus/compiled/native/x86_64-linux/3m/fluxus-engine_ss.so
>>
>> But it's OK load in command line racket:
>>
>> $ racket
>> Welcome to Racket v7.4.
>> > (require fluxus/fluxus)
>> >
>>
>> Any comments?
>>
>> Thanks
>> Walter
>>
>> --
>> 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/a76162ca-ee89-4d62-be51-e6a81d6adfd3%40googlegroups.com
>> <https://groups.google.com/d/msgid/racket-users/a76162ca-ee89-4d62-be51-e6a81d6adfd3%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CAL3TdOOiTp0t_2cTmhNF%3DqSTLK%3Dz%3DP7LVHyGvtymwnp01hkB2A%40mail.gmail.com.


Re: [racket-users] Seeking good benchmark code for immutable hash and hash set usage

2019-08-22 Thread Robby Findler
(sorry for the self-followup; the unifier uses immutable hashes; grep
suggests the other hashes that get used a lot are mutable hashes)

On Thu, Aug 22, 2019 at 9:33 AM Robby Findler  wrote:
>
> It looks like the pattern unifier uses hashes. I'm not sure if it they
> would end up being good benchmarks (probably best to try to instrument
> the hashes to see if they actually get  used a lot or not) but there
> are redex benchmarks that measure how long it takes to find specific
> bugs and one of the generators they use involves the pattern unifier.
>
> https://docs.racket-lang.org/redex/benchmark.html
>
> I'm happy to help provide more pointers if it seems useful
>
> Robby
>
> On Wed, Aug 21, 2019 at 9:04 PM Ben Greenman
>  wrote:
> >
> > A few of the GTP benchmarks [1] use immutable hashes. Here's a link
> > with the ones that look most interesting:
> >
> > http://ccs.neu.edu/home/types/tmp/gtp-hash.tar.gz
> >
> >
> > And here's a small (untyped) program that uses code from the tr-pfds
> > library to make a trie:
> >
> > http://ccs.neu.edu/home/types/tmp/trie.tar.gz
> >
> >
> > Redex and the graph library might be good places to look for other
> > examples. I know graph uses lots of hashes internally, and I bet Redex
> > does too.
> >
> > [1] https://github.com/bennn/gtp-benchmarks
> >
> > On 8/14/19, Jon Zeppieri  wrote:
> > > Hello Racketeers,
> > >
> > > I'm looking for examples of code that would make good benchmarks for
> > > evaluating the performance of immutable hashes.
> > >
> > > Some background:
> > > Immutable hashes used to be implemented in Racket as red-black trees.
> > > That was changed to hash array mapped tries (HAMTs) a number of years
> > > back. In Racket CS, the current implementation is a Patricia trie.
> > > That choice was based largely on the fact that it performed
> > > significantly faster on the hash demo benchmarks[1] that any of the
> > > HAMT variants I tested against. In particular, the write performance
> > > of the HAMTs seemed especially poor.
> > >
> > > However, on some real-world code[2] I recently had occasion to test, a
> > > HAMT consistently performs better than the Patricia trie, _especially_
> > > on writes, which makes me think I put entirely too much weight on the
> > > hash demo benchmark.
> > >
> > > So I'm looking for more realistic cases to use for benchmarking. If
> > > you have a Racket application or library that makes heavy use of
> > > immutable hashes or hash sets (from the racket/set module), please let
> > > me know.
> > >
> > > Thanks,
> > > Jon
> > >
> > > [1] 
> > > https://github.com/racket/racket/blob/master/racket/src/cs/demo/hash.ss
> > > I also tried to use the expander demo as a benchmark, but the timings
> > > weren't significantly different with different hash implementations.
> > >
> > > [2] https://github.com/racket/racket/pull/2766#issuecomment-520173585
> > > Well, it's a lot closer to real-world code than the hash demo.
> > >
> > > --
> > > 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/CAKfDxxwjPcWewzo2X5uXGH06Ud1hjURNuKFW59duXrZq4-7tWQ%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/CAFUu9R4dwNWS28MyApTYUkiQ-%2BhV%3DuWPBAF77xMV-wNsDMduLw%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/CAL3TdOOrCRQ1FC%2BxU-tUgt5c2YjdJyxLCeuDpDwDgat%3DEe-aiA%40mail.gmail.com.


Re: [racket-users] Seeking good benchmark code for immutable hash and hash set usage

2019-08-22 Thread Robby Findler
It looks like the pattern unifier uses hashes. I'm not sure if it they
would end up being good benchmarks (probably best to try to instrument
the hashes to see if they actually get  used a lot or not) but there
are redex benchmarks that measure how long it takes to find specific
bugs and one of the generators they use involves the pattern unifier.

https://docs.racket-lang.org/redex/benchmark.html

I'm happy to help provide more pointers if it seems useful

Robby

On Wed, Aug 21, 2019 at 9:04 PM Ben Greenman
 wrote:
>
> A few of the GTP benchmarks [1] use immutable hashes. Here's a link
> with the ones that look most interesting:
>
> http://ccs.neu.edu/home/types/tmp/gtp-hash.tar.gz
>
>
> And here's a small (untyped) program that uses code from the tr-pfds
> library to make a trie:
>
> http://ccs.neu.edu/home/types/tmp/trie.tar.gz
>
>
> Redex and the graph library might be good places to look for other
> examples. I know graph uses lots of hashes internally, and I bet Redex
> does too.
>
> [1] https://github.com/bennn/gtp-benchmarks
>
> On 8/14/19, Jon Zeppieri  wrote:
> > Hello Racketeers,
> >
> > I'm looking for examples of code that would make good benchmarks for
> > evaluating the performance of immutable hashes.
> >
> > Some background:
> > Immutable hashes used to be implemented in Racket as red-black trees.
> > That was changed to hash array mapped tries (HAMTs) a number of years
> > back. In Racket CS, the current implementation is a Patricia trie.
> > That choice was based largely on the fact that it performed
> > significantly faster on the hash demo benchmarks[1] that any of the
> > HAMT variants I tested against. In particular, the write performance
> > of the HAMTs seemed especially poor.
> >
> > However, on some real-world code[2] I recently had occasion to test, a
> > HAMT consistently performs better than the Patricia trie, _especially_
> > on writes, which makes me think I put entirely too much weight on the
> > hash demo benchmark.
> >
> > So I'm looking for more realistic cases to use for benchmarking. If
> > you have a Racket application or library that makes heavy use of
> > immutable hashes or hash sets (from the racket/set module), please let
> > me know.
> >
> > Thanks,
> > Jon
> >
> > [1] https://github.com/racket/racket/blob/master/racket/src/cs/demo/hash.ss
> > I also tried to use the expander demo as a benchmark, but the timings
> > weren't significantly different with different hash implementations.
> >
> > [2] https://github.com/racket/racket/pull/2766#issuecomment-520173585
> > Well, it's a lot closer to real-world code than the hash demo.
> >
> > --
> > 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/CAKfDxxwjPcWewzo2X5uXGH06Ud1hjURNuKFW59duXrZq4-7tWQ%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/CAFUu9R4dwNWS28MyApTYUkiQ-%2BhV%3DuWPBAF77xMV-wNsDMduLw%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/CAL3TdOP9yZisqcK%2B96f5BW8YbarfHkyTkcQNf7GxHKva%3D1JsDw%40mail.gmail.com.


Re: [racket-users] Clarify project policy on racket2 syntax

2019-08-12 Thread Robby Findler
Points well taken, Neil. My messages were probably better unsent.

Robby

On Mon, Aug 12, 2019 at 9:50 AM Neil Van Dyke  wrote:
>
> Robby, I'm still not certain we all have a shared understanding of some
> of the concerns and where we all stand, so please let me try to get at
> that some of that:
>
> > As for adopting-new-syntax vs backwards-compatibility, does it help if I 
> > were to tell you that anything new will always be "opt in", in the sense 
> > that existing programs will continue to work completely unchanged with no 
> > special annotations or anything else like that required?
>
> I suspect, to many industry software engineers, this phrasing sounds
> like "deprecated", which is something we understand.  It's not something
> anyone likes to hear, unless we've already moved away from it, and we
> think that deprecating that is a positive sign.
>
> > There are piles of lecture notes (in the form of slide presentations 
> > written in Racket) from the late 90s (so not in any continuous integration 
> > system anywhere, as far as I know) that still run fine in today's Racket 
> > for example.
>
> I think this argument doesn't address the concerns of software engineers
> who know the history of Racket (and of countless possible parallels
> elsewhere).
>
> For one example, from Racket specifically, how the change to pair
> mutability was done meant that some of those modules in "compatibility"
> dialects no longer interoperate well with modern modules.  That's a big one.
>
> For a lesser example, which nevertheless was a problem in real-world
> practice: one of the changes to C extensions meant being locked to the
> old, non-default GC (missing out on enhancements, and concern it was
> more likely to break in the future, since most people had been pushed
> along to using the new thing, until that scary C extension code could be
> disturbed again).
>
> Another example was people who were using PLaneT's
> multiple-installed-package versions and SemVer-like updating, when that
> was deprecated and the functionality lost.
>
>  From an engineering perspective, over the last couple decades, Racket
> has done a good job, overall.  And an outstanding job, as academic-led
> projects go.  But, at this point, I think software engineers should want
> a clear understanding of top-level requirements for Racket, so they have
> an idea of what to expect.
>
> Some degree of trust factors into assessments of whether adopting or
> staying with such-and-such tech makes sense, and I'd think that arguing
> "some old CS101 lecture slides probably still work" is going to increase
> concern rather than reduce it. :)
>
> Some people (here, and in other venues) are skittish or turned off by
> various recent commotion.  At this point I could allay some of their
> concerns by mentioning multiple mitigation/transition options to them,
> but I'd prefer to keep all the value of the community we've built around
> Racket.
>
> Moving forward... Software engineers have learned to expect modern
> platform pitchers to often be disingenuous, or at least
> over-enthusiastic.  If core states, utterly unambiguously, and speaking
> as one, the top-level requirements that will guide Racket, and
> everything else clearly follows from those requirements, then I think
> that will increase confidence.  (Even if some of the articulated
> priorities are not ideal for our needs, we know what to plan with, with
> some confidence.)
>
> --
> 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/35d7b52a-abd7-e593-bcec-7f25ecde8f8d%40neilvandyke.org.

-- 
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/CAL3TdOOkXij%2B004hEeU0x54WUSYffs61cL%3DSYa%3Di0w0JO8dcJg%40mail.gmail.com.


Re: [racket-users] Clarify project policy on racket2 syntax

2019-08-12 Thread Robby Findler
Sounds like you're going to take a wait-and-see attitude, which sounds
wise to me, but you are also welcome to participate in the discussion!

As for adopting-new-syntax vs backwards-compatibility, does it help if
I were to tell you that anything new will always be "opt in", in the
sense that existing programs will continue to work completely
unchanged with no special annotations or anything else like that
required? There is the issue of documentation that others have raised
and how various writings about Racket might change to show example
programs -- that may well change depending on how successful the
new-syntax venture is, but Racket has been committed to backwards
compatibility in a way that few programming languages are. There are
piles of lecture notes (in the form of slide presentations written in
Racket) from the late 90s (so not in any continuous integration system
anywhere, as far as I know) that still run fine in today's Racket for
example.

Robby

On Mon, Aug 12, 2019 at 1:37 AM Atlas Atlas  wrote:
>
> My question was not about backwards compatibility, but about adopting new 
> default syntax.
> For me it is as good as dropping s-expressions because only default\main 
> syntax is what really mater for me.
> Sorry for not expressing myself clearly enough.
>
> воскресенье, 11 августа 2019 г., 21:47:20 UTC+3 пользователь Robby Findler 
> написал:
>>
>> Matthew posted an (IMO) clear explanation of the state of the thinking here 
>> earlier. tl;dr: sexpressions will never be abandoned and backwards 
>> compatibility with existing languages will be maintained for the foreseeable 
>> future.
>>
>> ... but read his message if you are worried.  I believe it is included in 
>> the github discussion you mention.
>>
>> Robby
>>
> --
> 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/e72b6c20-56a1-4d29-90e1-228877ea8f4c%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/CAL3TdOMFG610kXQwr8RPAOb5Cx%3DoF_-_v1bUUxwXth8X16Li3g%40mail.gmail.com.


Re: [racket-users] Clarify project policy on racket2 syntax

2019-08-11 Thread Robby Findler
Matthew posted an (IMO) clear explanation of the state of the thinking here
earlier. tl;dr: sexpressions will never be abandoned and backwards
compatibility with existing languages will be maintained for the
foreseeable future.

... but read his message if you are worried.  I believe it is included in
the github discussion you mention.

Robby

On Sun, Aug 11, 2019 at 1:32 PM Atlas Atlas 
wrote:

> I just see pretty broad discussion of new non s-expression syntax on
> GitHub with lots of code examples and even some draft specification.
> Here https://github.com/racket/racket2-rfcs/issues/3
> And here https://github.com/racket/racket2-rfcs/pull/88/
>
> And I just cannot understand whats going on.
>
> воскресенье, 11 августа 2019 г., 17:58:29 UTC+3 пользователь Manfred Lotz
> написал:
>>
>> On Sun, 11 Aug 2019 07:51:53 -0700 (PDT)
>> Atlas Atlas  wrote:
>>
>> > I don't known how racket is managed. Can someone clarify for me the
>> > future of Racket.
>> >
>> >
>> > Is abandoning s-expressions is sealed decision?
>> >
>> >
>> > What chances that this will happen? 10% 50% 80% 100%?
>> >
>>
>> As far as I understood the discussion we had here the chance of
>> abandoning s-expressions is 0%.
>>
>> The discussion was (and is presumably ongoing) about enhancing
>> Racket ...
>>
>> --
>> Manfred
>>
> --
> 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/6e41152a-970a-4c67-81b4-f57e303b26ce%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/CAL3TdOPWKC1serPWJW-OBFV7F11-%3DwoTd%2B5H7fonJM9mcw72sA%40mail.gmail.com.


Re: [racket-users] Unwelcome surprises using Scribble on a 90,000-word novel

2019-08-01 Thread Robby Findler
On Thu, Aug 1, 2019 at 12:54 PM Hendrik Boom  wrote:
> At present, @include-section invokes require.  Does it need to?  Does
> it actually export identifiers to the invoking scribble file?  Or is
> this just a convenient way of getting it to process the #lang line and
> treat the included file with scribble (or, I suppose, other) syntax and
> semantics?

Each #lang scribble/base (or other scribble languages) program turns
into a module that exports `doc`. @include-section[] uses that fact to
do its work. I think changing this aspect of scribble is not likely to
work well but if you wanted some other way (that wasn't section-based)
to break up your book then you could probably build it. Alternatively,
going with the flow would entail deciding to break up files only based
on the sectioning structure (roughly).  :)

Robby

-- 
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/CAL3TdOPy-vmF7MscGMEwj8mpsRKz2Xzu-upNahZdEX%2Br0WBiLA%40mail.gmail.com.


Re: [racket-users] Re: Using errortrace with repl-driven-development?

2019-07-23 Thread Robby Findler
In DrRacket, the "preserve stack trace" button actually corresponds to a
mode in the compiler that disables some optimizations [*]. The radio
buttons at the top (specifically the debugging one) control errortrace.

Robby

[*]
https://docs.racket-lang.org/reference/eval.html?q=Compile#%28def._%28%28quote._~23~25kernel%29._compile-context-preservation-enabled%29%29


On Wed, Jul 24, 2019 at 10:43 AM Alex Harsanyi 
wrote:

> If you are using DrRacket, you can go to the "Language/Choose Language..."
> menu, click on "Show Details", than make sure the "Preserve Stack Trace"
> checkbox is ticked.
>
> If you are using racket-mode in Emacs, you can evaluate the current buffer
> using "C-u F5" which will do the same thing.
>
> If you use racket from the command line, I think you can run it as:
>
> racket -l errortrace -l racket -i
>
> Hope this helps,
> Alex.
>
> On Wednesday, July 24, 2019 at 9:45:47 AM UTC+8, Anthony Quizon wrote:
>>
>> I've been trying to find a way to get better error messages in the racket
>> repl via the command line.
>> Specifically, better stack traces. At the moment, if you load a file in
>> the repl via ',enter' it doesn't give you any information about the line
>> number for errors.
>>
>> I've looked around in the users group but could only find:
>> racket -l errortrace -t .rkt
>>
>> This is pretty much what I'm looking for except that it only lets me use
>> this once and non-interactively.
>>
>> Is there an option in the (x)repl that lets me use errortrace
>> interactively for each input?
>>
> --
> 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/4cd2db48-0520-4d4b-b144-83b1e7badc1c%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/CAL3TdONYvPQ1qEOZ%3DK954wm1nAPGti1Fy8A53m1LmVE9B2o1Xg%40mail.gmail.com.


Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-07-23 Thread Robby Findler
On Tue, Jul 23, 2019 at 11:35 AM Thomas Dickerson
 wrote:
> Yes - the architecture we eventually settled on is a main submodule that does 
> roughly this to get a black-box value which we can pass back to a rendering 
> function to produce a gl-bitmap, and stick it in a snip.
>
> By the way - it seems you weren't the only person who doesn't use OpenGL very 
> often from Racket, because gl-bitmap had bit-rotted somewhat, compared to a 
> 'gl-styled canvas, but my PR got merged, and gl-bitmaps now support core 
> contexts.

Thank you!

Robby

-- 
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/CAL3TdOM9b90ojBpJZaS%3DpaFVZ6het6Nk54U-DXjn4L_2UZki8w%40mail.gmail.com.


Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-07-23 Thread Robby Findler
Sorry for letting this thread lapse. Wrt to your third option
mentioned below, would it work to make that option accessible via the
FFI? If so, then maybe you could make the "essentially phase shifted
everything" into "actually phase shifted everything" and then when you
get the result program have your #%module-begin call into the FFI to
actually run the program. Does that seem like a viable option?

Robby

On Mon, Jul 1, 2019 at 3:35 PM Thomas Dickerson
 wrote:
>
> On Mon, Jul 1, 2019 at 2:23 PM Philip McGrath  
> wrote:
>>
>>
>> I believe the main submodule will still be compiled the enclosing module is 
>> loaded from source, but that should be trivial: it really only needs a 
>> `require` and a function call. If the file has already been compiled to 
>> bytecode, the bytecode for the main submodule won't be loaded, nor for any 
>> of its transitive dependencies.
>>
>> Depending on how you are distributing your code, you may or may not want to 
>> add an indirection via `dynamic-require` to prevent the distribution 
>> building tools from shipping graphics libraries that you only need for the 
>> main submodule. (Basically this would be the reverse of what 
>> `racket/runtime-path` does.) I haven't done much with the tools for 
>> distributing built artifacts beyond toy experiments, but I think some of 
>> them may be able to do that stripping automatically or with e.g. a 
>> command-line flag, without needing a `dynamic-require`. At the maximum, you 
>> could put the graphics modules in their own package, analogous to the 
>> `foo`+`foo-lib`+`foo-doc`+`foo-test` convention: in that case, the support 
>> library for your main submodule (what I called 
>> `hypothetical-lanugage/private/render`) would just be a stub to 
>> `dynamic-require` the `render` function or do something useful if the 
>> graphics package isn't installed, like print a message to standard error.
>
>
> I'll chew on this, but if the dependencies for the main submodule need to be 
> available at the time that it is compiled, then the easiest thing may just be 
> doing a dynamic-require.
>
>>
>>  I haven't used OpenGL, from Racket or otherwise, but it might be possible 
>> to use a bitmap from `make-gl-bitmap` as a buffer for your OpenGL drawing 
>> and copy it to the canvas via `draw-bitmap`. If you have an existing foreign 
>> library that does the actual drawing, you can get a platform-specific 
>> pointer via `gl-context<%>`.
>
>
> That's an interesting possibility, and I shouldn't actually need the 
> gl-context pointer, just to make it current before calling the foreign 
> rendering code.
>
>>
>>  I suspect, though, that a solution would involve your support library 
>> cooperating with an extension set up by your #lang.
>
> Right, this is what we originally hand in mind.
>
>>
>> On the whole, though, either returning a snip or creating a new `frame%` 
>> would probably be easier. Using a new `frame%` would also be entirely 
>> independent of DrRacket: I expect it would work with racket-mode for Emacs, 
>> for example.
>
> frame% is portable, but also not a very nice UI. I'll see what can be done 
> with a snip.
>
> On Mon, Jul 1, 2019 at 2:56 PM Robby Findler  
> wrote:
>>
>> I think I'm missing a bit more context so I'll continue this line of
>> questions. The path that you seem to be heading down seems to be one
>> where you'll duplicate a lot of work that's already gone into
>> DrRacket, and it seems unlikely to me that it is the most productive
>
>
> Perhaps you could elaborate on the mechanisms you think we would be 
> duplicating, because those may provide either the entry points we're looking 
> for, or clarify a potential miscommunication on our end.
>
>>
>> Can you say a little more about what you want to do with DrRacket?
>
>
> Currently, most of our DSL programs are constructed automatically from 
> inferred geometry, and it's fine, because an artist/programmer doesn't need 
> to do any design work.
> Going forward, we would like to also be able to model reusable parametric 
> object classes that we can plug in to our scenes, and here it would be very 
> helpful to be able to visualize the geometry generated by our DSL programs 
> interactively.
> Rather than reinventing the wheel, and writing our own editor, we would like 
> to bend DrRacket to our will for that purpose; however, the current "Run" 
> button doesn't seem like quite the right UI for that.
>
>> Do you expect to be able to run these programs? If so, does it
>> make sense to run them when you aren't in the
>> embedde

Re: [racket-users] Re: Problem with `copy` method of image-snip%

2019-07-21 Thread Robby Findler
Maybe because get-extent in the super class vaches some information and
that cache doesn't get maintained if you override the method.

Robby

On Sun, Jul 21, 2019 at 12:09 PM Alex Harsanyi 
wrote:

>
> I am not entirely sure why (because I already spent more than 15 minutes
> on this :-) ), but the problem is with the `get-extent` method: just remove
> it, and let `image-snip%` handle the method.
>
> The `copy` method is not used in this case.
>
> Also, in your `on-char` and `on-event` methods, you might want to pass
> back any un-handled events back to the editor's `on-default-event` and
> `on-default-char` methods, otherwise, you will notice that the editor stops
> responding to some events since your code discards them.
>
> Alex.
>
> On Tuesday, July 16, 2019 at 11:01:41 PM UTC+8, Kshitij Sachan wrote:
>>
>> Update:
>>
>> I've narrowed down the problem to the `copy` method of the snip. When I
>> delete the copy method, I can see the snip perfectly, but it can't be
>> resized (because no copy method implemented).
>>
>> I removed the GL component, so now I'm only attempting to extend the
>> image-snip% class to resize a custom bitmap I load in (in my case just a
>> plain red circle I drew). When I highlight over the snip with my cursor, I
>> can see the bitmap below and it is resizing as well on a click (using
>> `set-bitmap`). However, if I don't highlight over the snip it appears plain
>> white.
>>
>> Another observations that may or may not help is:
>> Calling (send s get-bitmap) always returns the bitmap of the same size,
>> even if I've pressed on the snip several times to resize it.
>>
>> Here's the simplified code:
>> (require racket/gui
>>  racket/gui/base)
>>
>> ;; bitmap stuff
>> (define bits (make-bitmap 250 250))
>> (define bits-dc (new bitmap-dc% [bitmap bits]))
>> (send bits-dc set-brush "red" 'solid)
>> (send bits-dc set-pen "black" 3 'solid)
>> (send bits-dc draw-ellipse 1 1 248 248)
>>
>> (define snip (make-object image-snip% bits))
>>
>> ;; snip stuff
>> (define scroll-snip%
>>   (class image-snip%
>> (init bit-init)
>> (define snip-bitmap bit-init)
>> (inherit/super get-admin set-flags set-bitmap)
>> (init-field [w 100] [h 100])
>>
>> (super-make-object snip-bitmap)
>> (set-flags (list 'handles-events))
>>
>> (define/override (get-extent dc x y width height descent space lspace
>> rspace)
>>   (define (maybe-set-box! b v) (when b (set-box! b v)))
>>   (maybe-set-box! width w)
>>   (maybe-set-box! height h)
>>   (maybe-set-box! descent 1.0)
>>   (maybe-set-box! space 1.0)
>>   (maybe-set-box! lspace 1.0)
>>   (maybe-set-box! rspace 1.0))
>>
>> (define/override (on-char dc x y editorx editory event)
>>   (cond
>> [(equal? (send event get-key-code) 'down)
>>  (define admin (get-admin))
>>  (set! w (+ w 20))
>>  (set! h (+ h 20))
>>
>>  ;; brush/pen/draw ellipse
>>  (define new-bits (make-object bitmap% w h))
>>  (send bits-dc set-bitmap new-bits)
>>  (send bits-dc draw-ellipse x y (- w 2) (- h 2))
>>  (set! snip-bitmap new-bits)
>>
>>  (when admin
>>(send admin resized this #t))]
>> [(equal? (send event get-key-code) 'up)
>>  (define admin (get-admin))
>>  (set! w (- w 20))
>>  (set! h (- h 20))
>>
>>  ;; brush/pen/draw ellipse
>>  (define new-bits (make-object bitmap% w h))
>>  (send bits-dc set-bitmap new-bits)
>>  (send bits-dc draw-ellipse x y (- w 2) (- h 2))
>>  (super set-bitmap new-bits)
>>
>>  (when admin
>>(send admin resized this #t))]
>> [(equal? (send event get-key-code) 'escape)
>>  (define admin (get-admin))
>>  (set! w 150)
>>  (set! h 150)
>>
>>  ;; brush/pen/draw ellipse
>>  (define new-bits (make-object bitmap% w h))
>>  (send bits-dc set-bitmap new-bits)
>>  (send bits-dc draw-ellipse x y (- w 2) (- h 2))
>>  (super set-bitmap new-bits)
>>
>>  (when admin
>>(send admin resized this #t))]))
>>
>> (define/override (on-event dc x y editorx editory event)
>>   (cond
>> [(send event button-down?)
>>  (define admin (get-admin))
>>  (set! w (+ w 20))
>>  (set! h (+ h 20))
>>
>>  ;; brush/pen/draw ellipse
>>  (define new-bits (make-object bitmap% w h))
>>  (send bits-dc set-bitmap new-bits)
>>  (send bits-dc draw-ellipse x y (- w 2) (- h 2))
>>  (super set-bitmap new-bits)
>>
>>  (when admin
>>(send admin resized this #t))]))
>>
>> (define/override (draw dc x y left top right bottom dx dy draw-caret)
>>   ;; brush/pen/draw ellipse
>>   ;(define new-bits (make-object bitmap% w h))
>>   ;(send bits-dc set-bitmap new-bits)
>>   ;(send bits-dc draw-ellipse x y (- w 2) (- h 2))
>>   ;(set! snip-bitmap new-bits)
>>  

Re: [racket-users] Contracts referring to earlier elements?

2019-07-18 Thread Robby Findler
This is what ->i is for. The syntax of define/contract is slightly
misleading because it appears to place the contracts in scope of the
arguments but, as you notice, it doesn't. Happily ->i lets you give another
name to the argument and then you can use that one.

Robby

On Thu, Jul 18, 2019 at 10:48 PM Kevin Forchione  wrote:

> Hi guys,
> This is a little tricky to explain, so I’ll give a small example:
>
> [define/contract [foo x) (-> integer? not-x/c) body …)
>
> In this case the not-x/c is what I’m asking about. Some way that the
> contract can refer to a previous argument value? Ordinarily this would be a
> predicate, but the parameters don’t appear to be in the scope of the
> contract. so ((λ (v) (not (= v x))) won’t work here, but it gets at the
> issue I”m interested in. I could of course interrogate the arguments inside
> the body of the function, but was wondering if a contract could do so.
>
> Kevin
>
> --
> 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/33F99A77-8609-4C37-AF59-E407A38A066A%40gmail.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdON%2Bi7YfAxrPovgjBLigM8zSp5ECH3nBLjd3HE4BFGWsxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] using scribble for everything from category theory to poetry

2019-07-16 Thread Robby Findler
I'm not sure if I'm the best one to answer these, but here are my attempts.

On Mon, Jul 15, 2019 at 4:38 PM Hendrik Boom  wrote:
>
> I'm thinking of trying Scribble again now that I have a new computer.
> I found it unacceptably slow years ago when I tried it on a 80,000 word novel.
> I now, however, have a modern machine and it may be fast enough.
>
> I have a few questions before I convert *everything* I'm doing to scribble.
> Each of these questions are relevant to a particular planned use.  The more of
> them have positive answers, the more projects I'll be able to
> scribblify.
>
> (1) How does scribble handle mathematical notation?  Presumably there's a hack
> for when I'm generating TeX, but is there anything reasonable when generating
> HTML?  Mathjax is somewhat tolerable, but mathML would be nice.

That is an area that could use some help in Scribble land for now.
Something that went into mathjax and latex would be great. Maybe
others have libraries that are useful here?

> (2) How can I produce category-theoretical diagrams, such as the one on top of
> page 29 in section 3.7 in the pdf file
> https://www.logicmatters.net/resources/pdfs/GentleIntro.pdf
> Oh yes, category theorists also use different shapes of arrow
> heads and tails just to challenge us computer people.

Maybe a library on top of pict?

> (3) Are there practical ways of including images whose source code might be
> jpegs ot pngs?

Yes, sure. Any pict (or pict-convertible) can jus tbe dropped anywhere
in a scribble document that The Right Thing happens. They will be
either pngs or svg in the html output depending on how you call
scribble (e.g., via the command-line arguments).

> (4) How can I include other scribble files into a main scribble file *without*
> making it a separate section?  The tutorial
> https://docs.racket-lang.org/scribble/getting-started.html
> mentions include-section, but I'm looking for something like just C's
> #include.

Maybe Racket's `include`? You can also just call functions that return
text, of course.

x.rkt:

#lang at-exp racket
(define my-favorite-paragraph @{some text here})

y.rkt:

#lang scribble/base
@(require "x.rkt")
@my-favorite-paragaph


> (5) How can I make text conditional on the presence or absence of a
> command-line parameter of the value of a global variable?

Just use regular racket for this kind of thing.

> (6) How do I achieve precise, line-by-line control of indentation for poetry?

This might require you to set up a specific thing for Scribble to
generate in each of its backends and then call into it.

https://docs.racket-lang.org/scribble/config.html

I thin you probably want to make a very small thing at that layer and
then build an abstraction on top of it in Racket/scribble to use it.
Probably others have better experience here, tho.

Robby


> -- 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/20190715213817.ijeovk5hs5vifgs4%40topoi.pooq.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdOOpECSKLH5HNDWOn4d4d51BaM9pj6zGbWwd%2B1Xd_o_rUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket back button

2019-07-15 Thread Robby Findler
No, not currently; you have to cycle through the binding identifiers (next
binding occurrence).

Robby

On Mon, Jul 15, 2019 at 5:10 PM Luke Whittlesey 
wrote:

> In DrRacket I like being able to right click on an identifier and `Jump to
> Binding Occurance". Is there a way to "jump back" to where you jumped from?
>
> --
> 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/CA%2Bce6i007%3D-jkv%2BwUfkoJg-5YaJsXGgHn6jDUp%2BfPKHL3iK_Ww%40mail.gmail.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdOO-PvHnZn%2BP0ZA33GWGtE%2BHCEx%3DWUBeLhV60OmEfPg-Wg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Editor task: finding end of code on line

2019-07-05 Thread Robby Findler
On Fri, Jul 5, 2019 at 2:32 PM Jordan Johnson  wrote:
>
> Thanks for the reply, Robby.
>
> On Jul 2, 2019, at 19:11, Robby Findler  wrote:
> One note not related to what you ask: lines in editor<%> parlance are 
> soft-breaking; the methods about paragraphs are the ones you want.
> For which specific purpose?
>
> The method that c:e is bound to by default (end-of-line, IIRC — I’m on my 
> phone) is a line method, not paragraph, right? I am (wrongly?) confident that 
> it is the one I need to wrap for my new binding. When I tested it out in DrR 
> with an editor that had some wrapped lines, c:e behaved as I’d expected: it 
> jumps the cursor to the end of the row of characters the cursor is on, which 
> is right before the actual newline iff the line isn’t wrapped. (However, I’ve 
> only tried this with wrapping turned on.) Am I understanding correctly?

Oh, maybe you do want end of lines, in that case. Sorry for the noise.

Robby


> Does c:e have different behavior in editing Scribble or other less-schemey 
> texts? I’ve been assuming it is totally language-agnostic.
>
> Thanks again,
> J
>
> Robby
>
>
> On Tue, Jul 2, 2019 at 11:41 AM Jordan Johnson  wrote:
>>
>> Dear Racket folks,
>>
>> I’m trying to implement a keybinding to get me more familiar with the editor 
>> toolkit. I’m working on modifying the Ctrl+E keybinding so it behaves more 
>> like the Ctrl+A keybinding (which, once at the beginning of the line, 
>> toggles between the true beginning of the line and the beginning of 
>> non-whitespace text on the line). The behavior I want is (I think) outlined 
>> pretty well in the code below, but to be clear: if the cursor is already at 
>> the line end, I want Ctrl+E to make the cursor jump to (right after) the end 
>> of the last s-exp that ends to the left of the cursor on the present line if 
>> there is such a s-exp. (The cursor can stay put if there is no such s-exp.)
>>
>> Here’s what I have so far:
>>
>> ;;;
>> #lang s-exp framework/keybinding-lang
>>
>> (require drracket/tool-lib)
>>
>> (define (at-EOL? ed) ; text% -> Boolean, #true iff cursor is right before 
>> newline
>>   (define sp (send ed get-start-position))
>>   (= sp
>>  (send ed get-end-position)
>>  (send ed line-end-position (send ed find-line sp
>>
>> (define (go-to-eol ed evt)
>>   (send (send ed get-keymap) call-function "end-of-line" ed evt #t))
>>
>> (define (go-to-end-of-code-on-line ed) ;; text% -> void?
>>   ;; jump to the end of the code that is on the current line
>>   (void)) ;; TODO
>>
>> (keybinding "c:e" (λ (ed evt)
>> (if (at-EOL? ed)
>> (go-to-end-of-code-on-line ed)
>> (go-to-eol ed evt
>> ;;;
>>
>> Two questions for those of you who know the editor toolkit well:
>>
>> Given what’s in the tool-lib, what’d be the best way to approach writing 
>> go-to-end-of-code-on-line? (I was thinking: save cursor position & line no; 
>> move left/backward by one s-exp; then move right/forward by one s-exp; then 
>> check if still on the same line, and if not restore the cursor position from 
>> before the moves.)
>> Does it look like I’m on the right track, otherwise?
>>
>>
>> Thanks,
>> Jordan
>>
>> --
>> 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/641F6290-D258-4D8D-B774-CAF5D9327204%40fellowhuman.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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAL3TdOO-1u_25gOUGjhQXdWii4jkyub9F1PfWH6wZ0kG%2BEtp%3Dw%40mail.gmail.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdONMyecdQz0xx%3Dg2m2QD6Bgyh%2BMr2p0hGFYUV%3DzFbbR6DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Editor task: finding end of code on line

2019-07-02 Thread Robby Findler
One note not related to what you ask: lines in editor<%> parlance are
soft-breaking; the methods about paragraphs are the ones you want.

Robby


On Tue, Jul 2, 2019 at 11:41 AM Jordan Johnson  wrote:

> Dear Racket folks,
>
> I’m trying to implement a keybinding to get me more familiar with the
> editor toolkit. I’m working on modifying the Ctrl+E keybinding so it
> behaves more like the Ctrl+A keybinding (which, once at the beginning of
> the line, toggles between the true beginning of the line and the beginning
> of non-whitespace text on the line). The behavior I want is (I think)
> outlined pretty well in the code below, but to be clear: if the cursor is
> already at the line end, I want Ctrl+E to make the cursor jump to (right
> after) the end of the last s-exp that ends to the left of the cursor on the
> present line if there is such a s-exp. (The cursor can stay put if there is
> no such s-exp.)
>
> Here’s what I have so far:
>
> ;;;
> #lang s-exp framework/keybinding-lang
>
> (require drracket/tool-lib)
>
> (define (at-EOL? ed) ; text% -> Boolean, #true iff cursor is right before
> newline
>   (define sp (send ed get-start-position))
>   (= sp
>  (send ed get-end-position)
>  (send ed line-end-position (send ed find-line sp
>
> (define (go-to-eol ed evt)
>   (send (send ed get-keymap) call-function "end-of-line" ed evt #t))
>
> (define (go-to-end-of-code-on-line ed) ;; text% -> void?
>   ;; jump to the end of the code that is on the current line
>   (void)) ;; TODO
>
> (keybinding "c:e" (λ (ed evt)
> (if (at-EOL? ed)
> (go-to-end-of-code-on-line ed)
> (go-to-eol ed evt
> ;;;
>
> Two questions for those of you who know the editor toolkit well:
>
>1. Given what’s in the tool-lib, what’d be the best way to approach
>writing *go-to-end-of-code-on-line*? (I was thinking: save cursor
>position & line no; move left/backward by one s-exp; then move
>right/forward by one s-exp; then check if still on the same line, and if
>not restore the cursor position from before the moves.)
>2. Does it look like I’m on the right track, otherwise?
>
>
> Thanks,
> Jordan
>
> --
> 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/641F6290-D258-4D8D-B774-CAF5D9327204%40fellowhuman.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdOO-1u_25gOUGjhQXdWii4jkyub9F1PfWH6wZ0kG%2BEtp%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-07-01 Thread Robby Findler
On Mon, Jul 1, 2019 at 10:40 AM Thomas Dickerson
 wrote:
> On Sun, Jun 30, 2019 at 11:44 AM Robby Findler  
> wrote:
>>
>> May I ask why you need to have the C++ code embed Racket instead of
>> the other way around (ie using the FFI)?
>
>
> The short answer is this project is a very small part of a very large 
> enterprise C++ code base, and it's not reasonable to rewrite every single 
> program in our toolkit that needs to interact with our DSL to be a dynamic 
> library with a Racket front-end.

I think I'm missing a bit more context so I'll continue this line of
questions. The path that you seem to be heading down seems to be one
where you'll duplicate a lot of work that's already gone into
DrRacket, and it seems unlikely to me that it is the most productive.

Can you say a little more about what you want to do with DrRacket? I
guess there will be some program in your DSL that you'll want to work
with. Do you expect to be able to run these programs? If so, does it
make sense to run them when you aren't in the
embedded-in-the-huge-C++-code-base mode? How about compilation of the
programs (i.e. macro expansion)?

Robby

-- 
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/CAL3TdOO4pm3N%3DyzDdyuyVO-yBk2L5YF%3DFmnb-HwuBFpn%2BDcs_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Language-Specific Plugins: Toolbar button functionality to call drracket:eval:expand-program

2019-06-30 Thread Robby Findler
May I ask why you need to have the C++ code embed Racket instead of
the other way around (ie using the FFI)? Generally speaking, DrRacket
(and other Racket tools) are going to work better if they get to
"drive", I expect. (Put another way, I think Philip is giving you good
advice here, fwiw.)

Robby


On Wed, Jun 26, 2019 at 11:05 AM Thomas Dickerson
 wrote:
>
> Hi,
>
> Chiming in here, because Kshitij is working on this project for me.
> It sounds like Philip has answered (3) and most of (2).
>
> On Tuesday, June 25, 2019 at 10:06:07 PM UTC-4, Philip McGrath wrote:
>>
>> The functionality you describe—in particular, setting up clean evaluation 
>> contexts—sounds a lot like what the "Run" button already does. Unless you 
>> have some other notion of "running" in mind for programs in your DSL, I 
>> think what you describe could be accomplished nicely with a "main" 
>> submodule, which (as you may know) is run only when its enclosing module is 
>> invoked as a main program, not when it is required as a library. One benefit 
>> is that this would make this functionality independent of DrRacket.
>
>
> A couple additional bits of context:
>
> The DSL he is working on is embedded in a C++ application and strongly typed, 
> so we have several different notions of "running", which are orthogonal to 
> DrRacket's run button:
>
> The language is a language for describing parametric 3D models, not for 
> rendering, and the final result of being evaluated by Racket is a module 
> containing a provided result value, which is a pointer to a C++ object which 
> represents some a low level program evaluated by our C++ runtime to produce a 
> triangle mesh.
> Our C++ applications obtain the result value from a DSL program by calling 
> scheme_dynamic_require in the inner loop of a Racket interpreter we've 
> stuffed into a coroutine.
> When the toolbar button is pushed in DrRacket we want to evaluate the program 
> in a fresh namespace, (dynamic-require ''module-name 'result), and then pass 
> that result value into a C++ FFI function that will handle the C++ side of 
> evaluation and doing the actual OpenGL calls to visualize it in the editor. 
> This should have similar behavior to the run button from an evaluation 
> standpoint, but after evaluating the program, enter a render loop until, e.g. 
> the button is pushed again to stop rendering. Here, the DrRacket plugin is 
> responsible for creating the OpenGL context, which could be in a separate 
> window, but as Kshitij said it would be ideal if we could figure out how to 
> add a pane below the REPL.
>
>
>>
>>
>> To illustrate what I mean, your source program:
>> #lang hypothetical-lanugage
>> (hypothetical-code)
>> would be transformed by the reader into:
>> (module example hypothetical-lanugage
>>   (#%module-begin
>> (hypothetical-code)))
>> Then, your `#%module-begin` macro might expand to something like:
>> (module example hypothetical-lanugage
>>   (#%plain-module-begin
>> (provide shape)
>> (define shape (hypothetical-code))
>> (module* main racket/base
>>   (require (submod "..")
>>hypothetical-lanugage/private/render)
>>   (render shape
>>
>> What I'm most unsure of about your question is that you say you want to use 
>> a "C++ library that contains a function that takes in a module object as 
>> input." Do you mean that you want to use the Racket C API to create a new 
>> primitive module or something? That is not a very common thing to do. Racket 
>> modules are not first-class values. While you can produce a value 
>> representing the compiled form of a module (`compiled-module-expression?`) 
>> by doing something like:
>> (compile '(module foo racket/base))
>> that is rarely what you want to do. In particular, the result of calling 
>> `eval` is not a module (unless of course you do something like `(eval 
>> '(compile '(module foo racket/base)) (make-base-namespace))`.
>>
>> Calling `eval` on a module form, compiled or otherwise, merely declares the 
>> module: it doesn't immediately do anything. For example, this expression:
>> (let ([ns (make-base-namespace)])
>>   (eval '(module effects racket/base
>>(println "running"))
>> ns)
>>   (println "module evaluated")
>>   (eval '(require 'effects) ns))
>> prints:
>> "module evaluated"
>> "running"
>> because the module isn't run until the `require` form is evaluated. Also, 
>> `eval` handles expanding the program already: manual expansion is only 
>> needed if you want to do some kind of static analysis.
>
>
> What is the "correct" way to get the current program source code from the 
> DrRacket editor to pass into eval?
> drracket:eval:expand-program seemed closest, given the type of the first 
> argument, but the plugin documentation is not clear and we don't actually 
> know how to get the relevant input port or text-pos.
>
>
>
>
> On Wednesday, June 26, 2019 at 12:06:36 AM UTC-4, Jack Firth wrote:
>>
>> This sounds very similar to pict3d, 

Re: [racket-users] managing competing access to filesystem within places

2019-06-23 Thread Robby Findler
On Sat, Jun 22, 2019 at 9:45 PM Matthew Butterick  wrote:

>
>
> On 06 22 19, at 6:14 AM, Robby Findler  wrote:
>
> One thing you can do, when the place-specific communication takes
> multiple steps is to, like you did in the first example, put the
> channels into a hash, but then on each iteration of the loop, pull all
> of them out and put them into a giant select that takes the relevant
> step forward for that specific piece of the communication
>
>
> Not sure what you mean by "giant select" — ought that be "giant sync"?
>

Right, thanks.


But as for "sequential access to some shared state" — In this toy example,
> maybe more along the lines of your suggestion, the server makes a random
> sequence of workers and triggers the workers in turn, so none of them are
> ever working at the same time. (So they could, in principle, all be writing
> to a single file.)
>
> I can imagine a more nuanced version involving each worker chekcing out
> sets of files, and the server permitting progress by more than one worker
> at a time, so long as the file sets didn't overlap.
>
>
>
I'm attaching an example of what I was trying to get at for your
consumption. Hope you find it useful.

Robby

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


places-example.rkt
Description: Binary data


Re: [racket-users] managing competing access to filesystem within places

2019-06-22 Thread Robby Findler
Thanks!

One thing you can do, when the place-specific communication takes
multiple steps is to, like you did in the first example, put the
channels into a hash, but then on each iteration of the loop, pull all
of them out and put them into a giant select that takes the relevant
step forward for that specific piece of the communication (you use
handle-evt to wrap the successful communication with the state update
and then the call to `loop` back for some other step or of
(potentially) some other communication).

The advantage to this kind of setup is that you have sequential access
to some shared state that is kept entirely on the server side. So  you
completely avoid the conventional pitfalls of mutable state combined
with concurrency.

For example, if your main loop was the one that was parcelling out,
say, files to compile, you could keep a list of the pending files to
compile on the server and when each worker finished with a file or
encountered a new file, it would let the server know and the server
would tell it what to do, eg "oh, wait, someone else is compiling that
file" or "go ahead, I've noted that you're the one that's compiling
that file and I'll tell others who also need it to wait for you to
finish". And the latter case, the worker that was waiting would also
get an evt that would become ready when the file was finish compiling
(which would also be mediated through the server).

Robby


On Fri, Jun 21, 2019 at 11:02 PM Matthew Butterick  wrote:
>
>
>
> On 06 15 19, at 8:31 AM, Robby Findler  wrote:
>
> A standard way to work with this is to send a channel over in the
> first communication and then the communication that's specific to that
> initial request happens on that channel. The precise way you set this
> up depends on what invariants of the communication you want. Like, you
> can create a new thread and just do all the communication there
>
>
>
> And here's a threaded version, which I agree is neater, because by closing 
> over each worker channel, the threads make other channel-tracking 
> housekeeping unnecessary.
>
> #lang racket
> (require racket/place)
> (provide main)
>
> (define (main)
>   (define loopback-p
> (place lch
>(let loop ()
>  (define wp (place-channel-get lch))
>  (thread (λ () (let loop ()
>  (place-channel-put wp (place-channel-get wp))
>  (loop
>  (loop
>
>   (define worker-ps
> (for/list ([i (in-range (processor-count))])
>   (place wch
>  (let make-request ([count 1])
>(define countout (place-channel-put/get wch count))
>(displayln (format "worker request ~a:~a got response ~a:~a ~a"
>   0 count 0 countout
>   (if (eq? count countout) "" "### fail")))
>(make-request (add1 count))
>
>   (for ([worker-p (in-list worker-ps)])
> (place-channel-put loopback-p worker-p))
>
>   (map place-wait worker-ps))
>
> --
> 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/A5055051-898C-46F9-82C6-BD0A50AC4D20%40mbtype.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdOMxQpQWTiCgvirzy9_gAvUxdbSxTdxurMwnuSGHTThQfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   5   6   7   8   >