[racket-users] Re: [racket-dev] RacketCon is next weekend!

2020-10-09 Thread 'John Clements' via Racket Users
Just checked out the gather space. It looks very cool. How about some easter 
eggs?

John

> On Oct 9, 2020, at 7:07 AM, Jay McCarthy  wrote:
> 
> To the friends and followers of Racket,
> 
> You have produced thousands of commits since last Con. You have honored your 
> ancestors and brought glory to Racket. RacketCon is next weekend, from Friday 
> to Sunday, come and see.
> 
> https://con.racket-lang.org/
> 
> Kathi Fisler will keynote, and we will hear about distribution from Webber 
> and computation from Konrad, come and see.
> 
> https://con.racket-lang.org/
> 
> I want you to hear about Brian's web framework and Sage's dependency tracker. 
> Attend RacketCon for free and these worries will no longer trouble you. If 
> you don't watch, then you'll miss Pierce on randomness and Gustavo on type 
> recovery. You won't take part in the Racket town hall, or hear about Jesse's 
> riposte, Peter's contract generator, or Panicz's sketches. Stephen's games 
> will be less fun and Ben will shallowly type to no one but me. Come and see.
> 
> https://con.racket-lang.org/
> 
> Come and see, come and see, attendance is free, come and see:
> 
> https://con.racket-lang.org/
> 
> Tweet your friends and your bros, to please come and see.
> 
> Jay
> 
> --
> Jay McCarthy
> Associate Professor @ CS @ UMass Lowell
> http://jeapostrophe.github.io
> Vincit qui se vincit.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-dev/CAJYbDa%3DhzCXRRycZUig3rFfhzfcw-yUjxB-9aqKOWYjgXJ9gmw%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/7b8995d9-9a14-491d-8f76-c35d28343a79%40mtasv.net.


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

2020-09-15 Thread 'John Clements' via Racket Users
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 
>  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 
>  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 
>  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  
> 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.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> 
> 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.
> 

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

2020-09-10 Thread 'John Clements' via Racket Users
Shriram, have you ruled out the classic multi-paste prolem? It looks very much 
like that’s what you’re seeing here.

That is, if you paste a string that ends with a newline into the “do what I 
mean” box, it will appear still to be blank. So you paste it again. So you 
paste it again. Eventually you figure it out and paste a string that doesn’t 
end with a newline, but then it tries to download from a URL that contains 
about five newlines in it. 

Again, to repeat:

1) Highlight a string ending with a newline.
2) Open the Package Manager box
3) Click in the “do what I mean box”.
4) Hit cmd-v. see that the box appears blank
5) Hit it a few more times, then click “install”.

I believe this should be fixed, and it should be an easy fix. I haven’t fixed 
it myself.

John


> On Sep 10, 2020, at 10:16, Shriram Krishnamurthi  wrote:
> 
> The original student (on Windows 10) has confirmed they were able to install 
> with raco on the shell, which further lends credence to the likelihood that 
> the PM and raco are doing something differently.
> 
> (I have some other issues w/ the caching and how clearing out the trash 
> doesn't seem to affect the cache, but I'll put that off for another day. <-;)
> 
> On Thu, Sep 10, 2020 at 10:06 AM Philip McGrath  
> wrote:
> Also, this is happening over encrypted HTTPS: no one is sniffing the 
> User-Agent header.
> 
> My initial attempt to reproduce in the GUI package manager was foiled because 
> I’d first tried installing at the command line, and the package manager used 
> a cached copy of the repository. From Shriram’s update last night, it sounds 
> like the GUI package manager and “raco pkg” are doing something differently.
> 
> 
> -- 
> -Philip
> 
> -- 
> 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/CAJUf2yQTO5dN7yKjvGu_mR13cD2BdkAHLGj2DU7Xdyeo5Ww-RQ%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/3a55bb1f-e501-42cc-a75e-eb4d48077cca%40mtasv.net.


Re: [racket-users] Advice for beginner

2020-09-08 Thread 'John Clements' via Racket Users
Can you be more specific? Are there particular programs that you can point to? 
I think the solution to your problem is going to depend a bit on the kind of 
slowdowns that you’re seeing.

Best,

John Clements


> On Sep 7, 2020, at 05:04, Denis Maier  wrote:
> 
> 
> Hi,
> 
> I've started working with the Htdp textbook as I'd like to acquire a solid 
> foundation in (functional) programming. The approach to teaching programming 
> looks very promising. Having this ressource available online for free is 
> absolutely amazing. Thank you.
> 
> One slight annoyance I came across: I've found running code snippets with the 
> beginning languages rather slow, much slower than with `#lang racket`. Why is 
> that? Anything I could do to make that more performant? (Actually, running 
> simple racket snippets is much faster in the REPL than with DrRacket. Is 
> there a way to use the BSLs on the command line?)
> 
> Or: Could I just use work through the textbook with `#lang racket`? How 
> different is racket from the student languages? Are they subsets, i.e. will 
> everything that works in those languages also work with racket proper?
> 
> 
> All the best,
> Denis Maier
> 
> -- 
> 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/ec53a53a-bc4e-4fb1-a92a-87682cb8f731n%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/510b3f59-048e-4111-95e1-875b6601baf5%40mtasv.net.


[racket-users] slideshow -> google slides?

2020-08-06 Thread 'John Clements' via Racket Users
Has anyone here developed a reasonable workflow for exporting slideshow 
presentations to google slides? It appears that google slides cannot import 
PDFs or SVGs. It looks like it has support for importing PPT files, 
unsurprisingly, but AFAIK slideshow won’t export ppt files. I have no idea how 
nasty the PPT format is.

Right now I’m looking into PDFelement, a mac program, but I’d love to hear 
about other options. 

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/7a2b8538-91f9-45e2-9006-5e8047d39973%40mtasv.net.


Re: [racket-users] Racket v7.8

2020-08-04 Thread 'John Clements' via Racket Users
Yes, there is documentation for this feature! Here are two ways to get it:

1) On a machine with 7.8 installed, run `raco docs prop:struct-field-info` at 
the command line, or (equivalently) highlight the word in drracket and hit F1. 
Both of these open a web browser window pointed at your local documentation 
installation.

2) Wait a few days for the 7.8 docs to be installed at docs.racket-lang.org.

Best,

John

> On Aug 4, 2020, at 10:28, 'Joel Dueck' via Racket Users 
>  wrote:
> 
> I'm very interested in the prop:struct-field-info property. Is there any 
> documentation on it? I notice docs.racket-lang.org still says 7.7 up at the 
> top.
> 
> Thanks to everyone for this release!
> 
> On Monday, August 3, 2020 at 12:19:57 PM UTC-5 johnbclements wrote:
> This release announcement mistakenly omitted two important contributors: Tim 
> Brown, and Dionna Amalie Glaze. Many thanks for their help! 
> 
> John Clements 
> 
> > On Aug 3, 2020, at 09:35, John Clements  wrote: 
> > 
> > Racket version 7.8 is now available from 
> > 
> > https://racket-lang.org/ 
> > 
> > 
> > * Racket CS may become the default Racket implementation in the next 
> > release. With the improvements in this release, Racket CS provides all 
> > of the functionality of Racket BC (the current default 
> > implementation). If, between this release and the next, no bugs are 
> > discovered in Racket CS that are more serious than those typically 
> > discovered in Racket BC, then Racket CS will become the default for 
> > the next release. 
> > 
> > * Racket CS supports AArch32 and AArch64, including places and 
> > futures. The implementation should be considered experimental in this 
> > initial release. 
> > 
> > * Racket CS supports an "incremental" garbage-collection mode that can 
> > eliminate long GC pauses for some applications, such as animations and 
> > interactive games. 
> > 
> > * Racket CS unboxes local floating-point arithmetic (like Racket BC). 
> > 
> > * DrRacket's spell check features lower overhead and has fewer bugs. 
> > 
> > * Web Server performance under high concurrency is [better by up to an 
> > order of magnitude](https://github.com/racket/web-server/pull/94/). 
> > The Web Server is also more resistant to clients attempting to use 
> > unconstrained resources. 
> > 
> > * The math library includes the Kronecker product. 
> > 
> > * Windows supports finer granularity for `sleep` when sleeping for short 
> > periods of time, improving performance in animation. 
> > 
> > * The new prop:struct-field-info property provides static information 
> > about field names. 
> > 
> > * Debugging context in Racket CS is limited to 64,000 frames 
> > (approximately the same as Racket BC). This reduces the time taken to 
> > handle out-of-memory failures. 
> > 
> > * In `plot`, the legend font and the plot font can be controlled 
> > independently, and error-bars have an `#:invert?` option. 
> > 
> > * The plot and math libraries have new maintainers: Alex Harsányi for 
> > plot and Pavel Pancheka and Jens Axel Søgaard for math. 
> > 
> > 
> > The following people contributed to this release: 
> > 
> > Alex Harsányi, Alex Knauth, Alexander Shopov, Alexis King, Andrew Kent, 
> > Andrew Mauer-Oats, Atharva Raykar, Ben Greenman, Benjamin Yeung, Bert De 
> > Ketelaere, Bogdan Popa, David Christiansen, David Florness, Diego 
> > Crespo, Fred Fu, Gary Baumgartner, Georges Dupéron, Gustavo Massaccesi, 
> > J. Ian Johnson, Jack Firth, Jay McCarthy, Jens Axel Søgaard, Jesse 
> > Alama, John Clements, Laurent Orseau, Leif Andersen, Luka Hadži-Đokić, 
> > Marc, Matthew Butterick, Matthew Flatt, Matthew Parris, Matthew Turland, 
> > Matthias Felleisen, Michael Ballantyne, Mike Sperber, Noah W M, Paulo 
> > Matos, Pavel Panchekha, Philip McGrath, Raphael Das Gupta, Reuben 
> > Thomas, Ricardo Herdt, Robby Findler, Ryan Culpepper, Sam 
> > Tobin-Hochstadt, Sancho McCann, Sorawee Porncharoenwase, Spencer 
> > Florence, Stephen De Gabrielle, Syntacticlosure, frogbird, kryptine, 
> > rsiddharth, and yurkobb 
> > 
> > Feedback Welcome 
> > 
> 
> 
> 
> 
> -- 
> 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/c5c0ad1d-d8d5-43c3-bceb-228d89e1d16fn%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/b09bd279-19b3-4c0c-b91f-0a40242eb3d5%40mtasv.net.


[racket-users] Re: Racket v7.8

2020-08-03 Thread 'John Clements' via Racket Users
This release announcement mistakenly omitted two important contributors: Tim 
Brown, and Dionna Amalie Glaze. Many thanks for their help!

John Clements

> On Aug 3, 2020, at 09:35, John Clements  wrote:
> 
> Racket version 7.8 is now available from
> 
>https://racket-lang.org/
> 
> 
> * Racket CS may become the default Racket implementation in the next
>  release. With the improvements in this release, Racket CS provides all
>  of the functionality of Racket BC (the current default
>  implementation). If, between this release and the next, no bugs are
>  discovered in Racket CS that are more serious than those typically
>  discovered in Racket BC, then Racket CS will become the default for
>  the next release.
> 
> * Racket CS supports AArch32 and AArch64, including places and
>  futures. The implementation should be considered experimental in this
>  initial release.
> 
> * Racket CS supports an "incremental" garbage-collection mode that can
>  eliminate long GC pauses for some applications, such as animations and
>  interactive games.
> 
> * Racket CS unboxes local floating-point arithmetic (like Racket BC).
> 
> * DrRacket's spell check features lower overhead and has fewer bugs.
> 
> * Web Server performance under high concurrency is [better by up to an
>  order of magnitude](https://github.com/racket/web-server/pull/94/).
>  The Web Server is also more resistant to clients attempting to use
>  unconstrained resources.
> 
> * The math library includes the Kronecker product.
> 
> * Windows supports finer granularity for `sleep` when sleeping for short
>  periods of time, improving performance in animation.
> 
> * The new prop:struct-field-info property provides static information
>  about field names.
> 
> * Debugging context in Racket CS is limited to 64,000 frames
>  (approximately the same as Racket BC). This reduces the time taken to
>  handle out-of-memory failures.
> 
> * In `plot`, the legend font and the plot font can be controlled
>  independently, and error-bars have an `#:invert?` option.
> 
> * The plot and math libraries have new maintainers: Alex Harsányi for
>  plot and Pavel Pancheka and Jens Axel Søgaard for math.
> 
> 
> The following people contributed to this release:
> 
> Alex Harsányi, Alex Knauth, Alexander Shopov, Alexis King, Andrew Kent,
> Andrew Mauer-Oats, Atharva Raykar, Ben Greenman, Benjamin Yeung, Bert De
> Ketelaere, Bogdan Popa, David Christiansen, David Florness, Diego
> Crespo, Fred Fu, Gary Baumgartner, Georges Dupéron, Gustavo Massaccesi,
> J. Ian Johnson, Jack Firth, Jay McCarthy, Jens Axel Søgaard, Jesse
> Alama, John Clements, Laurent Orseau, Leif Andersen, Luka Hadži-Đokić,
> Marc, Matthew Butterick, Matthew Flatt, Matthew Parris, Matthew Turland,
> Matthias Felleisen, Michael Ballantyne, Mike Sperber, Noah W M, Paulo
> Matos, Pavel Panchekha, Philip McGrath, Raphael Das Gupta, Reuben
> Thomas, Ricardo Herdt, Robby Findler, Ryan Culpepper, Sam
> Tobin-Hochstadt, Sancho McCann, Sorawee Porncharoenwase, Spencer
> Florence, Stephen De Gabrielle, Syntacticlosure, frogbird, kryptine,
> rsiddharth, and yurkobb
> 
> Feedback Welcome
> 



-- 
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/67a075d1-a160-4fe1-a11f-137f06277127%40mtasv.net.


[racket-users] Racket v7.8

2020-08-03 Thread 'John Clements' via Racket Users
Racket version 7.8 is now available from

https://racket-lang.org/


* Racket CS may become the default Racket implementation in the next
  release. With the improvements in this release, Racket CS provides all
  of the functionality of Racket BC (the current default
  implementation). If, between this release and the next, no bugs are
  discovered in Racket CS that are more serious than those typically
  discovered in Racket BC, then Racket CS will become the default for
  the next release.

* Racket CS supports AArch32 and AArch64, including places and
  futures. The implementation should be considered experimental in this
  initial release.

* Racket CS supports an "incremental" garbage-collection mode that can
  eliminate long GC pauses for some applications, such as animations and
  interactive games.

* Racket CS unboxes local floating-point arithmetic (like Racket BC).

* DrRacket's spell check features lower overhead and has fewer bugs.

* Web Server performance under high concurrency is [better by up to an
  order of magnitude](https://github.com/racket/web-server/pull/94/).
  The Web Server is also more resistant to clients attempting to use
  unconstrained resources.

* The math library includes the Kronecker product.

* Windows supports finer granularity for `sleep` when sleeping for short
  periods of time, improving performance in animation.

* The new prop:struct-field-info property provides static information
  about field names.

* Debugging context in Racket CS is limited to 64,000 frames
  (approximately the same as Racket BC). This reduces the time taken to
  handle out-of-memory failures.

* In `plot`, the legend font and the plot font can be controlled
  independently, and error-bars have an `#:invert?` option.

* The plot and math libraries have new maintainers: Alex Harsányi for
  plot and Pavel Pancheka and Jens Axel Søgaard for math.


The following people contributed to this release:

Alex Harsányi, Alex Knauth, Alexander Shopov, Alexis King, Andrew Kent,
Andrew Mauer-Oats, Atharva Raykar, Ben Greenman, Benjamin Yeung, Bert De
Ketelaere, Bogdan Popa, David Christiansen, David Florness, Diego
Crespo, Fred Fu, Gary Baumgartner, Georges Dupéron, Gustavo Massaccesi,
J. Ian Johnson, Jack Firth, Jay McCarthy, Jens Axel Søgaard, Jesse
Alama, John Clements, Laurent Orseau, Leif Andersen, Luka Hadži-Đokić,
Marc, Matthew Butterick, Matthew Flatt, Matthew Parris, Matthew Turland,
Matthias Felleisen, Michael Ballantyne, Mike Sperber, Noah W M, Paulo
Matos, Pavel Panchekha, Philip McGrath, Raphael Das Gupta, Reuben
Thomas, Ricardo Herdt, Robby Findler, Ryan Culpepper, Sam
Tobin-Hochstadt, Sancho McCann, Sorawee Porncharoenwase, Spencer
Florence, Stephen De Gabrielle, Syntacticlosure, frogbird, kryptine,
rsiddharth, and yurkobb

Feedback Welcome



-- 
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/d8b39382-2355-49e5-b3ff-e37de39d6cb0%40mtasv.net.


Re: [racket-users] with-continuation-marks in errortrace

2020-07-27 Thread 'John Clements' via Racket Users
Let me jump in here and say a few things that maybe everyone already knows :).

The stepper’s annotation places a *ton* of annotation on a computation, and 
allows the reconstruction of the full computation. Errortrace does less, and 
provides less.

The both share a goal of allowing the programmer to see “where you are in the 
computation”, by capturing “what remains to be done in the computation”, and 
neither one tries to capture “how we got here”.

Specifically, in the (* (loop (sub1 n) n) expression, a mark on the application 
of loop is currently overwritten immediately by the mark on the body of the 
called function. In this case, the still-present mark on the multiplication is 
telling you “this multiplication still remains to be done”, but in fact you’ve 
lost important information on *which* of the subterms of the multiplication is 
currently being evaluated. In the stepper, this is essentially converted to 
a-normal form so that the mark isn’t just “the multiplication isn’t done yet” 
but rather “the second argument hasn’t yet been evaluated.”

My understanding of your proposal is that it suggests preserving the first mark 
that is associated with a continuation, rather than (or perhaps in addition to) 
the last.

I do think that this could be helpful in some situations.

I also think that the fundamental problem that you point to in the beginning 
isn’t one of what information to store, though, but rather how it’s presented. 
Specifically, the presence of the mark around the multiplication captures the 
following information: “we’re currently in a call to loop, and we’re evaluating 
either the first or second argument of this multiplication”. I’m not sure what 
a good way to present this information would be:

> in call to ‘loop’, at either (* [] n) or (* (loop (sub1 n) []).

yeah, that was terrible. Ugh. Surely someone can do better than that.

Anyhow, my point is that for the example that I believe you’re examining, the 
information you want can be extracted from the information that’s present.

I would like to acknowledge though, that that’s definitely *not* always the 
case; if you have a bunch of calls that only make tail calls, then you can 
easily lose information about how you got here. I understand that from a 
programmer’s standpoint, the question “how did we get here” may be more 
relevant than “where are we now,” and I do think that it might make sense to 
take the same approach that (IIRC) Andrew Tolmach & others took in the ML 
debugger of saving a rolling sequence of up to five marks (or six or ten or 
whatever you choose).

Put differently, I think that there is potentially a “lost information” 
situation here, but I think that if you want to preserve that information, you 
should do so by using a rolling buffer, rather than by supplementing “last 
expression” with “first expression”.

More broadly, I also think that errortrace’s display of information is probably 
not the best; I think it’s been a long time since anyone was thinking hard 
about how best to convey the errortrace information to the programmer. 
Apologies if I’m wrong about that.

AND, as always, apologies if I’m misunderstanding something important about 
your proposal!

Best,

John


> On Jul 27, 2020, at 09:26, Matthew Flatt  wrote:
> 
> At Sun, 26 Jul 2020 20:21:56 -0700, Sorawee Porncharoenwase wrote:
>> I have been toying with another way to instrument the code. It roughly
>> expands to:
>> 
>> (define-syntax-rule (wrap f)
>>  (call-with-immediate-continuation-mark
>>   'errortrace-k
>>   (λ (k)
>> (let ([ff (thunk f)])
>>   (if k
>>   (ff)
>>   (with-continuation-mark 'errortrace-k 'f
>> (ff)))
> 
> This variant probably generates faster code:
> 
> (define-syntax-rule (wrap f)
>   (call-with-immediate-continuation-mark
>'errortrace-k
>(λ (k)
>  (with-continuation-mark 'errortrace-k (or k 'f)
>f
> 
> 
>> Now, the question: why is the current errortrace implemented in that way?
>> Am I missing any downside of this new strategy? Would switching and/or
>> integrating with the new strategy be better?
> 
> I don't recall there was any careful study of the alternatives. Always
> setting the mark is easiest, and so that's probably why the current
> implementation always sets the mark. Maybe keeping the first expression
> for a frame instead of the last is consistently more useful.
> 
> At Sun, 26 Jul 2020 20:39:35 -0700, Sorawee Porncharoenwase wrote:
>> (By "integrating" with the new strategy, I meant having two keys: one for
>> the new strategy and one for the old strategy. I can see that the first
>> entry of the old strategy is useful, and it's missing in the new strategy).
> 
> Instead of a separate mark, `or` above could be replaced by some
> combinator that keeps more information in the mark value, such as a
> first and last call using a pair:
> 
> (define-syntax-rule (wrap f)
>   (call-with-immediate-continuation-mark
>'errortrace-k
>

Re: [racket-users] note about parsing speed of xml vs sxml?

2020-07-01 Thread 'John Clements' via Racket Users
Ryan, I just tested your pull request, and… it doesn’t make much difference in 
my example.

One important thing that I realize that I *totally neglected* to mention is 
that I’m running CS racket here, not BC. Based on my experiments, it appears 
that 

1) CS is much faster than BC for both xml(read-xml) and sxml (ssax:xml->sxml), 
and
2) CS speeds up sxml more dramatically.

Here are the results of running my tests with ryan’s/your PR:

pajaro2:/tmp clements> racketcs zz.rkt
cpu time: 12858 real time: 15642 gc time: 4242
ssax:warn: warning at position 150: DOCTYPE DECL plist 
http://www.apple.com/DTDs/PropertyList-1.0.dtd found and skipped
cpu time: 2157 real time: 2342 gc time: 332
pajaro2:/tmp clements> racketcs zz.rkt
cpu time: 10518 real time: 11248 gc time: 3544
ssax:warn: warning at position 150: DOCTYPE DECL plist 
http://www.apple.com/DTDs/PropertyList-1.0.dtd found and skipped
cpu time: 2183 real time: 2327 gc time: 305
pajaro2:/tmp clements> racketcs zz.rkt
cpu time: 10162 real time: 10706 gc time: 3363
ssax:warn: warning at position 150: DOCTYPE DECL plist 
http://www.apple.com/DTDs/PropertyList-1.0.dtd found and skipped
cpu time: 2188 real time: 2325 gc time: 328

(so actually, the first of these was pretty bad. … I suspect that’s a rare 
occurrence.

This broadly matches my first set of timings, which suggests that in racket CS, 
parsing an 18 Megabyte XML file generated by Apple Music “Export Library…” is 
about four times faster in sxml than in xml. 

In BC, by the way, parsing using xml takes about 14 seconds, and parsing using 
sxml takes about seven.

So really, I think maybe the on-the-side takeaway from this is this: CS is much 
faster than BC in this case.

John

> On Jun 28, 2020, at 17:30, Ryan Culpepper  wrote:
> 
> Thanks Alex for pointing out the use of list->string. I've created a PR 
> (https://github.com/racket/racket/pull/3275) that changes that code to use 
> string ports instead (similar to Hendrik's suggestion, but the string port 
> handles resizing automatically). Could someone (John?) with some large XML 
> files lying around try the changes and see if they help?
> 
> Ryan
> 
> 
> On Sun, Jun 28, 2020 at 9:56 PM Neil Van Dyke  wrote:
> If anyone wants to optimize `read-xml` for particular classes of use, 
> without changing the interface, it might be very helpful to run your 
> representative tests using the statistical profiler.
> 
> The profiler text report takes a little while of tracing through 
> manually to get a feel for how to read and use it, but it can be 
> tremendously useful, and is worth learning to do if you need performance.
> 
> After a first pass with that, you might also want to look at how costly 
> allocations/GC are, and maybe do some controlled experiments around 
> that.  For example, force a few GC cycles, run your workload under 
> profiler, check GC time during, and forced time after.  If you're 
> dealing with very large graphs coming out of the parser, I don't know 
> whether those are enough to matter with the current GC mechanism, but 
> maybe also check GC time while you're holding onto large graphs, when 
> you release them, and after they've been collected.  At some point, GC 
> gets hard for at least me to reason about, but some things make sense, 
> and other things you decide when to stop digging. :)  If you record all 
> your measurements, you can compare empirically the how different changes 
> to the code affect things, hopefully in representative situations.
> 
> I went through a lot of these exercises to optimize a large system, and 
> sped up dynamic Web page loads dramatically in the usual case (to the 
> point we were then mainly limited by PostgreSQL query cost, not much by 
> the application code in Scheme, nor our request network I/O), 
> and also greatly reduced the pain of intermittent request latency spikes 
> due to GC.
> 
> One of the hotspots, I did half a dozen very different implementations, 
> including C extension, and found an old-school pure Scheme 
> implementation was fastest.  I compared the performance of the 
> implementation using something like `shootout`, but there might be 
> better ways now in Racket. https://www.neilvandyke.org/racket/shootout/  
> I also found we could be much faster if we made a change to what the 
> algorithm guarantees, since it was more of a consistency check that 
> turned out to be very expensive and very redundant, due to all the ways 
> that utility code ended up being used.
> 
> In addition to contrived experiments, I also rigged up a runtime option 
> so that the server would save data from the statistical profiler for 
> each request a Web server handled in production.  Which was tremendously 
> useful, since it gave us real-world examples that were also difficult to 
> synthesize (e.g., complex dynamic queries), and we could go from Web 
> logs and user feedback, to exactly what happened.
> 
> (In that system I optimized, we used Oleg's SXML tools very heavily 
> 

Re: [racket-users] FYI, build from HEAD fails in realloc()

2020-06-30 Thread 'John Clements' via Racket Users
D’oh!  Closing the loop on this one… it appears to me that this problem 
occurred after running a “make” (that is, a BC make) in a directory in which 
I’d been running “make cs”). I just did it again, which is how I figured it 
out. It’s a silly mistake on my part. It seems that running “math.scrbl” 
triggers the problem. Honestly, I have no idea if this is a bug or not.

John

> On Mar 23, 2020, at 04:34, Paulo Matos  wrote:
> 
> Hi John,
> 
> Has anyone already looked into this? I haven't seen this problem yet. If
> it's not solved, can you please open an issue?
> 
> Thanks,
> 
> Paulo Matos
> 
> 'John Clements' via Racket Users writes:
> 
>> Bang! I was wrong. Here’s another similar trace:
>> 
>> raco setup: 6 running: 
>> /pfds/pfds/scribblings/functional-data-structures.scrbl
>> raco setup: 4 running: /jbc-utils/gradeserver/gradeserver.scrbl
>> raco setup: 3 running: 
>> /htdp-doc/scribblings/htdp-langs/htdp-langs.scrbl
>> raco setup: 2 running: /images-doc/images/scribblings/images.scrbl
>> raco setup: 0 running: 
>> /macro-debugger/macro-debugger/macro-debugger.scrbl
>> raco setup: 7 running: /math-doc/math/scribblings/math.scrbl
>> raco setup: 5 running: /net-doc/net/scribblings/net.scrbl
>> raco setup: 1 running: /compatibility-doc/mzlib/scribblings/mzlib.scrbl
>> raco setup: 4 running: /racket-doc/openssl/openssl.scrbl
>> raco setup: 4 running: 
>> /optimization-coach/optimization-coach/scribblings/optimization-coach.scrbl
>> raco setup: 4 running: 
>> /option-contract-doc/scribblings/option-contract.scrbl
>> raco setup: 4 running: /net-doc/net/scribblings/osx-ssl.scrbl
>> raco setup: 5 running: /overeasy/overeasy.scrbl
>> raco setup: 4 running: /parsack/parsack/parsack.scrbl
>> raco setup: 1 running: 
>> /parser-tools-doc/parser-tools/parser-tools.scrbl
>> raco setup: 5 running: /pict-doc/pict/scribblings/pict.scrbl
>> raco setup: 1 running: 
>> /pict-snip-doc/scribblings/pict-snip/pict-snip.scrbl
>> raco setup: 4 running: 
>> /picturing-programs/picturing-programs/picturing-programs.scrbl
>> raco setup: 1 running: /racket-doc/pkg/scribblings/pkg.scrbl
>> raco setup: 4 running: /plai-doc/scribblings/plai.scrbl
>> raco setup: 1 running: /planet-doc/planet/planet.scrbl
>> raco setup: 4 running: /plot-doc/plot/scribblings/plot.scrbl
>> racket(54631,0x762f) malloc: *** error for object 0x12f96cdc8: 
>> pointer being realloc'd was not allocated
>> racket(54631,0x762f) malloc: *** set a breakpoint in 
>> malloc_error_break to debug
>> make[2]: *** [in-place-setup] Abort trap: 6
>> make[1]: *** [plain-in-place] Error 2
>> make: *** [in-place] Error 2
>> make  240.77s user 75.70s system 398% cpu 1:19.32 total
>> 
>> 
>>> On Mar 20, 2020, at 3:11 PM, 'John Clements' via Racket Users 
>>>  wrote:
>>> 
>>> Here’s the tail of a build of racket HEAD that just failed during a call to 
>>> realloc(). I went back far enough to be sure I had a full record of what 
>>> was running on cores 0-7. 
>>> 
>>> I strongly suspect this is not reproducible, and I don’t think there’s any 
>>> further information that would be useful here, alas.
>>> 
>>> John
>>> 
>>> raco setup: 1 running: 
>>> /pfds/pfds/scribblings/functional-data-structures.scrbl
>>> raco setup: 0 running: 
>>> /future-visualizer/future-visualizer/scribblings/future-visualizer.scrbl
>>> raco setup: 4 running: /games/scribblings/games.scrbl
>>> raco setup: 6 running: 
>>> /racket-doc/scribblings/getting-started/getting-started.scrbl
>>> raco setup: 6 running: /games/gl-board-game/gl-board-game.scrbl
>>> raco setup: 0 running: /GLPK/glpk/glpk.scrbl
>>> raco setup: 5 running: /jbc-utils/gradeserver/gradeserver.scrbl
>>> read-compiled-linklet: version mismatch  expected: "7.6.0.17"  found: "7.6" 
>>>  in: 
>>> /Users/clements/git-clements/pkgs/jbc-utils/gradeserver/compiled/gradeserver_scrbl.zo
>>> context...:
>>>  read-linklet-or-directory
>>>  read-dispatch
>>>  read-syntax
>>>  default-load-handler
>>>  standard-module-name-resolver
>>>  module-path-index-resolve
>>>  module-declared?
>>>  /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:1529:27
>>>  /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:904:0: 
>>> load-doc/ensure-prefix
>>>  /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:1162:13
>>>  .../parallel-do.rkt:388:17
>>>  
>>> /Users/clem

[racket-users] Sound scrubbing with rsound

2020-06-15 Thread 'John Clements' via Racket Users
To Advait Raykar:

In response to a Slack thread about a scrubbing interface for sound playback:

Looks like you folks covered all the bases on rsound. It sounds like the 
"right" interface for this would be something that plays a file from start to 
finish but also allows you to asynchronously alter the playback point.

There are several ways to do this. There’s a way that uses the existing 
interface, and there’s a lower-level way. Hmm… actually, there are multiple 
ways, for multiple definitions of “lower-level”.

I think the right way to go here is with the “pstream” interface; it should 
allow you to queue sounds to be played, and to then change your mind and 
schedule different sounds to be played (as e.g. when the user moves a scroll 
bar). In fact, I have a pretty distinct recollection that students have 
implemented this using big-bang, and it works pretty well. Let me look …

Yes, in fact, there’s an example file called “katy-sliders” that’s a part of 
the rsound package. which does something similar. Specifically, it uses a 
slider to control the speed of playback, allowing both forward and backward 
play. This is a whole lot more computationally intensive than a scrubbing 
interface such as the one you describe, so this essentially constitutes a 
proof-of-possibility.  This example actually uses the low-level “signal” 
interface, which is required because you’re computing the samples as you go, 
rather than just queueing existing sounds. 

I should mention that there was one small issue in the “katy-sliders” example, 
calling 2htdp/image’s “text” function with a third argument of “solid”. I 
conjecture that this used to work, but that the interface has probably changed 
slightly (though the change might just be better enforcement of an existing 
contract). I’ve pushed an update to this, but you can make the change easily if 
you try running the file. Also, the file depends has a hard-coded dependency on 
a “/tmp/partygoing.wav” file, but you should be able to update this and point 
it to any wav you like.

I should also note that it looks like low-level manipulations of signed 16-bit 
numbers is either different or missing in CS racket, so for the moment, this 
code doesn’t run correctly in Racket CS.

Let me finish by suggesting a sequence of actions:

1) Convert your mp3 to a wav file.
2) Try the rsound/examples/katy-sliders.rkt file, to convince yourself that 
something like this is possible.
3) Write your own program using the pstream interface to implement a scrubber.

Let me know if you run into problems!

John Clements



-- 
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/b366520a-628b-4e8a-b8a2-e2a809e2f3ac%40mtasv.net.


Re: [racket-users] Finite state machine

2020-05-28 Thread 'John Clements' via Racket Users
Good to hear from you!

Unfortunately, it’s going to be really hard to help you without more 
information.

Can you give us some context on what your goal is, here? Is this part of a 
class? Your problem seems very under-specified.

John

> On May 27, 2020, at 8:53 PM, Med Ra  wrote:
> 
> Dear All, i'm a new member in the group and also a debutante in racket 
> programming and i will be happy if you read and understand what i'm asking .
> 
> I want create a finite state machine to represent an hotel room booking 
> system.
> 
> first , i have created the FSM Scheme as the following :
> 
> about Rooms ---> (state (available) (unavailble))
> two inputs ---> Time: T = 1 if some room will be available in the required 
> entering date in future.
>   Full Of F = 1if all the rooms are full at the moment.
> 
> I just want some help about how create this on drracket coding, And please 
> forgive my ignorance !
> 
> Thanks for attention.
> 
> 
> -- 
> 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/ee6807b0-8b02-40c1-8eeb-f41a01fa31d6%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/a6463687-9c43-4592-b0f1-a5914d47972a%40mtasv.net.


Re: [racket-users] Migrating from a "model-driven" language framework to Racket

2020-05-26 Thread 'John Clements' via Racket Users
Okay, I could just be putting my foot in my mouth, here, but it sounds like 
you’re describing the kinds of things that are typically done by a 
type-checker. Have you considered adding a type-checking pass? It would contain 
an environment that maps names like “h1” to “types” that indicate that h1 is an 
instance of half-adder-arch.

In your case, the type checker would also be “resolving” lightweight 
expressions like (assign (h1 a) a) into fully-decorated expressions like 
(assign (port-ref half-adder h1 a) (port-ref full-adder a)) .

Does this make sense?

John


> On May 26, 2020, at 12:08 PM, Guillaume Savaton  
> wrote:
> 
> Le mardi 26 mai 2020 03:59:59 UTC+2, johnbclements a écrit :
> > So far, I have made two attempts to work around these issues: (1) by 
> > creating a metamodel-like data structure using Racket structs, and 
> > transforming syntax objects into struct instances; or (2) using syntax 
> > objects only and attaching context data to each of them as a syntax 
> > property. 
> > Both have strengths and weaknesses, and I am still feeling that I am not 
> > using Racket with the right mindset. 
> 
> I think your (2) sounds like a lighter-weight solution. However, it 
> definitely does seem as though much of the difficulty here is related to the 
> differences between a more imperative and a more functional style.
> 
> I'm not sure that solution (2) is lighter. Maybe the weight is moved to 
> another part of the implementation :)
> 
> I have set up an example at this address: 
> https://gist.github.com/senshu/c6db95615b4b2567f168d6bfbe61655e
> 
> It is basically a very stripped-down hardware description language that 
> borrows from VHDL and Verilog.
> Like VHDL, the description of a circuit is split into an "entity" (the 
> interface of the circuit) and an "architecture" (the implementation).
> For the sake of simplicity, this example does not implement a complete model 
> of computation.
> 
> The file "tiny-hdl-example-v1.rkt" implements a full adder and prints its 
> truth table.
> At this point, there is no name resolution, so I need to give redundant 
> information in the "port-ref" expressions.
> A better version of the language would allow to write:
> 
> (assign (h1 a) a)
> 
> instead of:
> 
> (assign (port-ref half-adder h1 a) (port-ref full-adder a))
> 
> because we know that
>   • h1 is an instance of half-adder-arch, that has the entity half-adder,
>   • the current architecture is full-adder-arch and its entity is 
> full-adder
> I hope it clarifies my current concerns.
> 
> Guillaume
> 
> -- 
> 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/a42ec2de-6441-483f-a05a-910c03c317e8%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/d7263942-5e70-49ac-977e-9d8a2471389c%40mtasv.net.


Re: [racket-users] Migrating from a "model-driven" language framework to Racket

2020-05-25 Thread 'John Clements' via Racket Users
> ...

> So far, I have made two attempts to work around these issues: (1) by creating 
> a metamodel-like data structure using Racket structs, and transforming syntax 
> objects into struct instances; or (2) using syntax objects only and attaching 
> context data to each of them as a syntax property.
> Both have strengths and weaknesses, and I am still feeling that I am not 
> using Racket with the right mindset.

I think your (2) sounds like a lighter-weight solution. However, it definitely 
does seem as though much of the difficulty here is related to the differences 
between a more imperative and a more functional style. I think your idea of a 
simplified example—especially one illustrating the situations in which context 
information is required—would be an excellent idea!

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/f560d4b5-9707-4be8-8644-d41c8f249b1b%40mtasv.net.


Re: [racket-users] running Racket inside gradescope

2020-05-19 Thread 'John Clements' via Racket Users
100% yes but no. I am a long-time gradescope user, and I’ve been very happy 
with it. However, my usage has been entirely with scanned paper exams. I like 
the work that Gradescope has been doing, but I haven’t engaged with any of 
their tools beyond the paper-scanning ones, so I definitely don’t have anything 
to contribute to your work beyond tips on how best to use a paper cutter to 
remove staples from student exams. Also, the last time I checked, their 
“complete” tier was a bit rich for my blood; I would have to find a way to get 
the students to pay for it themselves if I were to seriously consider it.

John



> On May 19, 2020, at 11:42 AM, Shriram Krishnamurthi  wrote:
> 
> We expect to use Racket with Gradescope [https://www.gradescope.com/] in the 
> fall. Gradescope will run an autograder for programming assignments, using 
> this specification:
> 
> https://gradescope-autograders.readthedocs.io/en/latest/
> 
> (It's manifest as a Docker container.)
> 
> Has anyone already set up Gradescope for use in their classes? 
> 
> If so, can you share your work with us?
> 
> If not, are you a potential user?
> 
> 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/24255ddf-7b2e-4563-a45a-92ff5fa07e6c%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/94c9ceaf-fc9d-4f48-b9ea-0f87994b4232%40mtasv.net.


[racket-users] I should probably stop ignoring this internal error on startup

2020-05-05 Thread 'John Clements' via Racket Users
I think I maybe get this error every time I start up. Is this normal? I tried 
moving all prefs files aside to see if it was a configuration error, and … same 
thing.

In fact, even when I go into the three listed directories (pkgs/algol60, 
collects/racket, collects/syntax/parse/lib) and delete all the compiled/ 
directories and re-run setup, I get the same thing. Maybe this is just a known 
thing? I don’t see any references in my e-mail, or in github issues for racket 
or drracket.

This is 

Welcome to DrRacket, version 7.7.0.4--2020-05-03(-/f) [cs].
Language: No language chosen; memory limit: 128 MB.

John

Error invoking tool 
#;("tool.rkt")

instantiate-linklet: mismatch;
 reference to a variable that is uninitialized;
 possibly, bytecode file needs re-compile because dependencies changed
  name: idX43.1
  exporting instance: 
"/Users/clements/racket-cs/racket/collects/racket/dict.rkt"
  importing instance: 
"/Users/clements/racket-cs/racket/collects/syntax/parse/lib/function-header.rkt"
  context...:
   raise-arguments-error
   body of 
"/Users/clements/racket-cs/racket/collects/syntax/parse/lib/function-header.rkt"
   extract-imported-variabless
   [repeats 14 more times]
   temp35_0
   for-loop
   run-module-instance!
   for-loop
   [repeats 1 more time]
   run-module-instance!
   for-loop
   [repeats 1 more time]
   run-module-instance!
   for-loop
   [repeats 1 more time]
   run-module-instance!



-- 
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/bb891b6f-801b-44f5-ae62-83b184234748%40mtasv.net.


[racket-users] Racket v7.7

2020-05-02 Thread 'John Clements' via Racket Users
Racket version 7.7 is now available from

https://racket-lang.org/

* Racket CS remains ready for production use---thanks to those who have
  been putting it into practice to help iron out the remaining
  kinks---and it now supports a C API for embedding into other
  applications. See the "Inside: Racket" documentation for details.

* Racket CS uses a new HAMT implementation, dramatically reducing the memory
  required for immutable hash tables.

* Optimizations to the Racket CS compiler result in a code size savings
  of approximately 20%.

* GC callbacks are reliably called on major collections in Racket CS.
  Also, garbage collection is 10-20% faster.

* DrRacket can recover much more quickly from errors involving large
  stack traces.

* DrRacket now supports the use of the keyboard in the macOS Catalina
  "Open File" dialog.

* The net/http-client collection supports the 'deflate' content encoding.

* The `call-in-continuation` function (like Marc Feeley's
  `continuation-graft`) simplifies certain `call/cc` patterns by
  calling a thunk in a restored continuation.

* The `call-with-current-language` form allows more reliable tests for language
  level code.

* Use of the Cairo library can be multi-threaded.

* Improved documentation!

* Many bug fixes!

The following people contributed to this release:

Alexander Shopov, Ben Greenman, Benjamin Yeung, Brian Adkins, Brian
Wignall, Chongkai Zhu, Craig Ferry, David Florness, Fred Fu, Greg
Hendershott, Gustavo Massaccesi, Ilnar Salimzianov, Jack Firth, James
Bornholt, Jay McCarthy, Jens Axel Søgaard, Jesse Alama, John Clements,
Jon Zeppieri, Kartik Singhal, Laurent Orseau, Leo Shen, Luka
Hadži-Đokić, Matthew Butterick, Matthew Flatt, Matthias Felleisen, Mike
Sperber, Noah W M, Paulo Matos, Philip McGrath, Philippe Meunier,
Ricardo Herdt, Robby Findler, Ryan Culpepper, Sam Tobin-Hochstadt,
Sorawee Porncharoenwase, Spencer Florence, Stephen Chang,
Syntacticlosure, Thaddäus Töppen, Tom Gillespie, Xu Chunyang, ZHUO
Qingliang, kryptine, mehlon, muzimuzhi, redwyn, and Štěpán Němec

Feedback Welcome



-- 
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/10eebecc-dd92-4f39-97ce-168bfa9e7ea1%40mtasv.net.


Re: [racket-users] FrTime magic updating seconds

2020-04-28 Thread 'John Clements' via Racket Users
Wait! I got it! I forgot. It’s not hash-lang. I have to choose the language via 
the “choose language…” menu.

Sorry for the noise, folks.

John

> On Apr 28, 2020, at 3:28 PM, 'John Clements' via Racket Users 
>  wrote:
> 
> Okay, I have several things to say about Father Time.
> 
> Thing one: running through these demos (frtime/demos) is kind of astonishing. 
> There just doesn’t seem to be enough code for it to do what it’s doing. The 
> father time programs are *incredibly* concise distillations of behavior. The 
> ball-pushing demo is almost magical.
> 
> Thing two: I have a very very clear memory of being able to run a program like
> 
> #lang frtime
> 
> (current-seconds)
> 
> and seeing a changing number in the interactions window. I can’t make that 
> work now, and I’ve tried versions back to 7.3, which is the oldest one I have 
> handy that still runs on my mac. I’ve tried various combinations of (seconds) 
> and (current-seconds), running in the definitions and interactions window, 
> and none seem to work “correctly” (that is, with a changing number in the 
> interactions window). Is this something that went away a long time ago? Did I 
> ask this question already? Sigh.
> 
> 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/f8b9118d-66c7-4735-89a0-9976a307ac56%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/438b5489-9e00-4f9d-8977-5172bed853f4%40mtasv.net.


[racket-users] FrTime magic updating seconds

2020-04-28 Thread 'John Clements' via Racket Users
Okay, I have several things to say about Father Time.

Thing one: running through these demos (frtime/demos) is kind of astonishing. 
There just doesn’t seem to be enough code for it to do what it’s doing. The 
father time programs are *incredibly* concise distillations of behavior. The 
ball-pushing demo is almost magical.

Thing two: I have a very very clear memory of being able to run a program like

#lang frtime

(current-seconds)

and seeing a changing number in the interactions window. I can’t make that work 
now, and I’ve tried versions back to 7.3, which is the oldest one I have handy 
that still runs on my mac. I’ve tried various combinations of (seconds) and 
(current-seconds), running in the definitions and interactions window, and none 
seem to work “correctly” (that is, with a changing number in the interactions 
window). Is this something that went away a long time ago? Did I ask this 
question already? Sigh.

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/f8b9118d-66c7-4735-89a0-9976a307ac56%40mtasv.net.


Re: [racket-users] New week, new Racket! What are you folks up to?

2020-04-22 Thread 'John Clements' via Racket Users
Alongside everything else, I started exploring writing code to post GraphQL 
queries (specifically in order to interact with Canvas). The language’s syntax 
is yet another needlessly complicated approximation to s-expressions, but I do 
have some things working. Not sure if I should put together a CRAPL-licensed 
starter kit as a package.

John Clements

> On Apr 19, 2020, at 10:04 AM, Stephen De Gabrielle  
> wrote:
> 
> New week, new Racket! What are you folks up to? 
> 
> Answer here or on 
> - https://racket.slack.com/ (Sign up at https://racket-slack.herokuapp.com/ ) 
> - `#racket` IRC on freenode.net https://botbot.me/freenode/racket/ 
> - Tweet @racketlang on Twitter 
> - Racket discord https://discord.gg/6Zq8sH5 
> - [r/racket](https://www.reddit.com/r/Racket) 
> 
> Don’t forget to sign up for, and contribute to Racket News at 
> https://racket-news.com/ AND submit your links to Racket Stories 
> https://racket-stories.com/
> 
> 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/07e9a208-c896-46e1-8a7e-9a94bceda393%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/01900ebd-a385-411a-9fad-0c2f9fe53e6c%40mtasv.net.


Re: [racket-users] Typed version of sxml?

2020-04-21 Thread 'John Clements' via Racket Users
Are you asking because you’d like your own code using SXML to be typed, or 
because you’d like the sxml implementation to be typed? I think another way of 
asking this is: are you worried about bugs in your code, or about bugs in 
Oleg’s code? I think that rewriting the sxml library into TR would be a lot of 
work, but developing a TR representation for sxml terms seems quite reasonable; 
of course, you’d pay the price of checking the type every time you crossed the 
boundary into sxml library code, I suppose.

John

> On Apr 21, 2020, at 2:18 PM, Hendrik Boom  wrote:
> 
> Is there a typed version of sxml?
> Its data representation would seem to be fairly easy to specify by a few 
> corecursice define-type's.
> 
> I's like to get the result of
>   (ssax:xml->sxml in '())
> as a typed value without having to waste time doing an exhaustive  
> run-time type-check on its output.  Because it *will* be OK.
> The xml file I'm dealing with is 2564178 bytes.
> 
> (I'm glad I have RAM nowadays.  The first Lisp I ever used ran on a 
> machine with 20.000 digits of memory (approx 10K in today's units).
> 
> Failing anything else I suppose I could define
>  (define-type Xml Any)
> but that seems kind of feeble.
> 
> -- 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/20200421211829.uo3ikwfwotr6zcf5%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/b14c3ce3-c8c5-400b-83e8-1d4de2cad2da%40mtasv.net.


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

2020-04-21 Thread 'John Clements' via Racket Users
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 
> >  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.


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

2020-04-21 Thread 'John Clements' via Racket Users
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 
>  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/dd520e71-a33f-4c47-af19-addcdce6f435%40mtasv.net.


[racket-users] visit a sequence of files

2020-04-21 Thread 'John Clements' via Racket Users
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.


Re: [racket-users] New to racket, help with coursework question

2020-04-19 Thread 'John Clements' via Racket Users
First off: you’re very close.

Thing two: I think you need a clearer comment on the meaning of the “months” 
vector. Your description does not actually say what the vector represents or 
contains.

Thing three: Here’s my question to you. Suppose that I tell you a year and a 
month and the result of (vector-ref months x). 

To be more concrete, suppose I tell you the year is 2234 and the month is 4 and 
the result of (vector-ref months x) is 30. How many days would that month have? 
Can you explain how to compute the answer for each of the test cases below?

John Clements

> On Apr 19, 2020, at 11:50, Suz Renae  wrote:
> 
> I am new to racket (first year student) and since class has been pushed to 
> online only, I am having a harder time.
> 
> We are currently working on vectors and hash tables. I feel like I keep 
> overthinking it and keep getting stuck. I know that the first parameter in 
> the function will be the year and the second will be the (vector-ref months 
> x)that I pull from the defined vector.
> 
> The question I am having a hard time with and what I have actually done below.
> 
> Create a function that calculates the number of days in a month given a year 
> and a month
>   • Call the function number-of-days-in-month, and it's signature is 
> number, number -> number
>   • Example:
> (number-days-in-month 2016 1) -> 31
> (number-days-in-month 2016 11) -> 30
> (number-days-in-month 2016 12) -> 31
> (number-days-in-month 1900 2) -> 28
> (number-days-in-month 2000 2) -> 29
> (number-days-in-month 2016 2) -> 29
> (number-days-in-month 2200 2) -> 28
> What I have so far...
> 
> ;Leap Year
> (define (leap-year? year)
>   (and (zero? (modulo year 4))
>(or (not (zero? (modulo year 100)))
>   (zero? (modulo year 400))
>   )
>)
>   )
> 
> ;Months with days vector, beginning at an index of 0 since there is not 0th 
> month
> (define months (vector 0 31 28 31 30 31 30 31 31 30 31 30 31))
> 
> (check-expect(number-days-in-month 2016 1)31)
> (check-expect(number-days-in-month 2016 11)30)
> (check-expect(number-days-in-month 2016 12)31)
> (check-expect(number-days-in-month 1900 2)28)
> (check-expect(number-days-in-month 2000 2)29)
> (check-expect(number-days-in-month 2016 2)29)
> (check-expect(number-days-in-month 2200 2)28)
> 
> I  need help with building the actual function and what conditionals I should 
> be using.
> 
> (define (number-days-in month ?? ??)
> (cond
>  [
> 
> -- 
> 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/5d017eef-b235-4a8b-94fa-fe1e3f7b766e%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/02cda61a-5bea-4087-8518-e4a44d4dfa56%40mtasv.net.


[racket-users] http basic auth needed for github

2020-04-01 Thread 'John Clements' via Racket Users
Relevance: our build scripts make automated queries to GitHub.

Historically, GitHub has allowed authentication using query parameters; both a 
user token and a client user/password pair could be specified as part of the 
URL. It now appears that this is being deprecated, per

https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/

My research suggests that both styles (token and client-user/pwd) essentially 
consist in adding a line to the headers. In the case of an api token, it 
appears to be a line of the form

Authorization: token 

I’ve tested this one, and it appears to work.

The other style of authentication (client auth) appears to use RFC 2617-style 
“basic” authentication. My reading of the RFC suggests that this essentially 
also consists of a request header line, of the form

Authorization: Basic 

… where the userid and password are appended with a colon and the base64 
encoded (and yes, everything breaks if you have a colon in your userid).

This one I haven’t implemented yet, I’m planning to come back when I need it 
(probably next week).

In the meantime, though, I thought I’d ask whether you two (or any of the rest 
of you) have recently made this adaptation, and can tell me about terrible 
mistakes that I’ve already made or am about to make.

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/6f823d16-45f2-424d-bbc0-7c2ad11f04e7%40mtasv.net.


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

2020-03-21 Thread 'John Clements' via Racket Users
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… 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 

Re: [racket-users] trace facility in Racket?

2020-03-21 Thread 'John Clements' via Racket Users
Right, sorry, I should have added… doing *that* (eliminating the traces for 
production code) is almost trivial: just make a macro that’s defined to 
disappear when a flag is set:

#lang racket

(define-for-syntax production-flag #f)

(define-syntax (debug-only stx)
  (syntax-case stx ()
[(_ expr)
 (if production-flag
 #'(void)
 #'expr)]))


(define (fact f)
  (if (= f 0)
  1
  (begin
(debug-only (printf "hello!\n"))
(* f (fact (- f 1))

(fact 6)

The hard part is building UI tools to manipulate and insert these things 
without any changes to the code at all.

John


> On Mar 21, 2020, at 11:36 AM, Nicholas Papadonis 
>  wrote:
> 
> Thanks, you answered my question.  I’m educating myself in ways to debug 
> Scheme, coming from an imperative background.  
> 
> I suspect the solution would be to leave the trace statements in and use a 
> conditional when delivering production code.
> 
> 
>> On Mar 21, 2020, at 2:27 PM, John Clements  wrote:
>> 
>> It sounds like you’re looking for a way to have the trace inserted for you 
>> by a debugging tool, so you don’t have to remember to take it out again 
>> later. This wouldn’t be hard to do, but (as far as I know) no one’s taken 
>> the time to do it.
>> 
>> John
>> 
>>> On Mar 21, 2020, at 8:43 AM, Nicholas Papadonis 
>>>  wrote:
>>> 
>>> I was successful with MIT Scheme placing (trace proc) inside the closure of 
>>> this code.  Placing (trace proc) outside the closure did not have any 
>>> effect.
>>> 
>>> This is the question I'm asking.  Is it possible to trace without modifying 
>>> the closure?
>>> 
>>> I ask due to forward thinking about software engineering practices and 
>>> modifying code (although it could be argued in C a preprocessor block could 
>>> be placed to compile in or out conditional macros blocks).
>>> 
>>> Thanks again
>>> 
>>> On Sat, Mar 21, 2020 at 11:24 AM Ben Greenman  
>>> wrote:
>>> On 3/21/20, dgtlcmo  wrote:
 Does anyone know how to trace functions inside a closure?  I would like to
 trace hanoi-move, however find that with MIT Scheme I need to place (trace)
 
 within the closure (hanoi n), otherwise the trace will not occur.
 
 Can a trace like this be performed in Racket?
 
 Thanks
 
 (define (hanoi n)
 (define (pmd from to)
   (display "Move ")
   (display from)
   (display " to ")
   (display to)
   (newline)
   '())
 (define (hanoi-move n from to spare)
   (cond ((= n 0) '())
 ((= n 1) (pmd from to))
 (else
 (hanoi-move (- n 1) from spare to)
 (hanoi-move 1 from to spare)
 (hanoi-move (- n 1) spare to from
 (hanoi-move n "A" "B" "C"))
>>> 
>>> Yes, Racket has trace tools:
>>> https://docs.racket-lang.org/reference/debugging.html
>>> 
>>> Try adding (trace hanoi) before the call to (hanoi-move ) at the bottom
>>> 
>>> -- 
>>> 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/CAKD0t1%2Bn_W7%3Dc7%3D_KAcFuJQrFo86JBx8uGJuBfXY%2BgZrDFKHWg%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/fbf7ed4c-1373-495c-b951-575c3cf7e61f%40mtasv.net.


Re: [racket-users] trace facility in Racket?

2020-03-21 Thread 'John Clements' via Racket Users
It sounds like you’re looking for a way to have the trace inserted for you by a 
debugging tool, so you don’t have to remember to take it out again later. This 
wouldn’t be hard to do, but (as far as I know) no one’s taken the time to do it.

John

> On Mar 21, 2020, at 8:43 AM, Nicholas Papadonis  
> wrote:
> 
> I was successful with MIT Scheme placing (trace proc) inside the closure of 
> this code.  Placing (trace proc) outside the closure did not have any effect.
> 
> This is the question I'm asking.  Is it possible to trace without modifying 
> the closure?
> 
> I ask due to forward thinking about software engineering practices and 
> modifying code (although it could be argued in C a preprocessor block could 
> be placed to compile in or out conditional macros blocks).
> 
> Thanks again
> 
> On Sat, Mar 21, 2020 at 11:24 AM Ben Greenman  
> wrote:
> On 3/21/20, dgtlcmo  wrote:
> > Does anyone know how to trace functions inside a closure?  I would like to
> > trace hanoi-move, however find that with MIT Scheme I need to place (trace)
> >
> > within the closure (hanoi n), otherwise the trace will not occur.
> >
> > Can a trace like this be performed in Racket?
> >
> > Thanks
> >
> >  (define (hanoi n)
> >   (define (pmd from to)
> > (display "Move ")
> > (display from)
> > (display " to ")
> > (display to)
> > (newline)
> > '())
> >   (define (hanoi-move n from to spare)
> > (cond ((= n 0) '())
> >  ((= n 1) (pmd from to))
> >  (else
> >   (hanoi-move (- n 1) from spare to)
> >   (hanoi-move 1 from to spare)
> >   (hanoi-move (- n 1) spare to from
> >   (hanoi-move n "A" "B" "C"))
> 
> Yes, Racket has trace tools:
> https://docs.racket-lang.org/reference/debugging.html
> 
> Try adding (trace hanoi) before the call to (hanoi-move ) at the bottom
> 
> -- 
> 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/CAKD0t1%2Bn_W7%3Dc7%3D_KAcFuJQrFo86JBx8uGJuBfXY%2BgZrDFKHWg%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/9c7a5a9d-c664-4dfe-8d86-02958035baa4%40mtasv.net.


Re: [racket-users] FYI, build from HEAD fails in realloc()

2020-03-20 Thread 'John Clements' via Racket Users
Bang! I was wrong. Here’s another similar trace:

raco setup: 6 running: 
/pfds/pfds/scribblings/functional-data-structures.scrbl
raco setup: 4 running: /jbc-utils/gradeserver/gradeserver.scrbl
raco setup: 3 running: /htdp-doc/scribblings/htdp-langs/htdp-langs.scrbl
raco setup: 2 running: /images-doc/images/scribblings/images.scrbl
raco setup: 0 running: /macro-debugger/macro-debugger/macro-debugger.scrbl
raco setup: 7 running: /math-doc/math/scribblings/math.scrbl
raco setup: 5 running: /net-doc/net/scribblings/net.scrbl
raco setup: 1 running: /compatibility-doc/mzlib/scribblings/mzlib.scrbl
raco setup: 4 running: /racket-doc/openssl/openssl.scrbl
raco setup: 4 running: 
/optimization-coach/optimization-coach/scribblings/optimization-coach.scrbl
raco setup: 4 running: 
/option-contract-doc/scribblings/option-contract.scrbl
raco setup: 4 running: /net-doc/net/scribblings/osx-ssl.scrbl
raco setup: 5 running: /overeasy/overeasy.scrbl
raco setup: 4 running: /parsack/parsack/parsack.scrbl
raco setup: 1 running: /parser-tools-doc/parser-tools/parser-tools.scrbl
raco setup: 5 running: /pict-doc/pict/scribblings/pict.scrbl
raco setup: 1 running: 
/pict-snip-doc/scribblings/pict-snip/pict-snip.scrbl
raco setup: 4 running: 
/picturing-programs/picturing-programs/picturing-programs.scrbl
raco setup: 1 running: /racket-doc/pkg/scribblings/pkg.scrbl
raco setup: 4 running: /plai-doc/scribblings/plai.scrbl
raco setup: 1 running: /planet-doc/planet/planet.scrbl
raco setup: 4 running: /plot-doc/plot/scribblings/plot.scrbl
racket(54631,0x762f) malloc: *** error for object 0x12f96cdc8: pointer 
being realloc'd was not allocated
racket(54631,0x762f) malloc: *** set a breakpoint in malloc_error_break 
to debug
make[2]: *** [in-place-setup] Abort trap: 6
make[1]: *** [plain-in-place] Error 2
make: *** [in-place] Error 2
make  240.77s user 75.70s system 398% cpu 1:19.32 total


> On Mar 20, 2020, at 3:11 PM, 'John Clements' via Racket Users 
>  wrote:
> 
> Here’s the tail of a build of racket HEAD that just failed during a call to 
> realloc(). I went back far enough to be sure I had a full record of what was 
> running on cores 0-7. 
> 
> I strongly suspect this is not reproducible, and I don’t think there’s any 
> further information that would be useful here, alas.
> 
> John
> 
> raco setup: 1 running: 
> /pfds/pfds/scribblings/functional-data-structures.scrbl
> raco setup: 0 running: 
> /future-visualizer/future-visualizer/scribblings/future-visualizer.scrbl
> raco setup: 4 running: /games/scribblings/games.scrbl
> raco setup: 6 running: 
> /racket-doc/scribblings/getting-started/getting-started.scrbl
> raco setup: 6 running: /games/gl-board-game/gl-board-game.scrbl
> raco setup: 0 running: /GLPK/glpk/glpk.scrbl
> raco setup: 5 running: /jbc-utils/gradeserver/gradeserver.scrbl
> read-compiled-linklet: version mismatch  expected: "7.6.0.17"  found: "7.6"  
> in: 
> /Users/clements/git-clements/pkgs/jbc-utils/gradeserver/compiled/gradeserver_scrbl.zo
>  context...:
>   read-linklet-or-directory
>   read-dispatch
>   read-syntax
>   default-load-handler
>   standard-module-name-resolver
>   module-path-index-resolve
>   module-declared?
>   /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:1529:27
>   /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:904:0: 
> load-doc/ensure-prefix
>   /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:1162:13
>   .../parallel-do.rkt:388:17
>   
> /Users/clements/racket/racket/collects/setup/../racket/private/more-scheme.rkt:261:28
>   /Users/clements/racket/racket/collects/setup/parallel-do.rkt:441:20: loop
> 
>  context...:
>   /Users/clements/racket/racket/collects/setup/parallel-do.rkt:332:4: 
> work-done method in list-queue%
>   /Users/clements/racket/racket/collects/setup/parallel-do.rkt:282:17
>   /Users/clements/racket/racket/collects/setup/parallel-do.rkt:236:4
>   /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:138:0: 
> setup-scribblings
>   /Users/clements/racket/racket/collects/setup/setup-core.rkt:72:0: setup-core
>   "/Users/clements/racket/racket/collects/setup/main.rkt": [running body]
>   temp35_0
>   for-loop
>   run-module-instance!
>   "/Users/clements/racket/racket/collects/raco/main.rkt": [running body]
>   temp35_0
>   for-loop
>   run-module-instance!
>   perform-require!
> raco setup: 5 running: /graph-doc/graph/scribblings/graph.scrbl
> raco setup: 4 running: /htdp-doc/graphics/scribblings/graphics.scrbl
> raco setup: 6 running: /gregor-doc/gregor/scribblings/gregor.scrbl
> raco setup: 2 running: /gui-doc/scribblings/gui/gui.scrbl
> raco setup: 0 running: 
> /handin/handin-server/scribblings/handin-server.scrbl
> raco setup: 4 running: /racket-doc/help/help.scrbl
> raco s

[racket-users] FYI, build from HEAD fails in realloc()

2020-03-20 Thread 'John Clements' via Racket Users
Here’s the tail of a build of racket HEAD that just failed during a call to 
realloc(). I went back far enough to be sure I had a full record of what was 
running on cores 0-7. 

I strongly suspect this is not reproducible, and I don’t think there’s any 
further information that would be useful here, alas.

John

raco setup: 1 running: 
/pfds/pfds/scribblings/functional-data-structures.scrbl
raco setup: 0 running: 
/future-visualizer/future-visualizer/scribblings/future-visualizer.scrbl
raco setup: 4 running: /games/scribblings/games.scrbl
raco setup: 6 running: 
/racket-doc/scribblings/getting-started/getting-started.scrbl
raco setup: 6 running: /games/gl-board-game/gl-board-game.scrbl
raco setup: 0 running: /GLPK/glpk/glpk.scrbl
raco setup: 5 running: /jbc-utils/gradeserver/gradeserver.scrbl
read-compiled-linklet: version mismatch  expected: "7.6.0.17"  found: "7.6"  
in: 
/Users/clements/git-clements/pkgs/jbc-utils/gradeserver/compiled/gradeserver_scrbl.zo
  context...:
   read-linklet-or-directory
   read-dispatch
   read-syntax
   default-load-handler
   standard-module-name-resolver
   module-path-index-resolve
   module-declared?
   /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:1529:27
   /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:904:0: 
load-doc/ensure-prefix
   /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:1162:13
   .../parallel-do.rkt:388:17
   
/Users/clements/racket/racket/collects/setup/../racket/private/more-scheme.rkt:261:28
   /Users/clements/racket/racket/collects/setup/parallel-do.rkt:441:20: loop

  context...:
   /Users/clements/racket/racket/collects/setup/parallel-do.rkt:332:4: 
work-done method in list-queue%
   /Users/clements/racket/racket/collects/setup/parallel-do.rkt:282:17
   /Users/clements/racket/racket/collects/setup/parallel-do.rkt:236:4
   /Users/clements/racket/pkgs/racket-index/setup/scribble.rkt:138:0: 
setup-scribblings
   /Users/clements/racket/racket/collects/setup/setup-core.rkt:72:0: setup-core
   "/Users/clements/racket/racket/collects/setup/main.rkt": [running body]
   temp35_0
   for-loop
   run-module-instance!
   "/Users/clements/racket/racket/collects/raco/main.rkt": [running body]
   temp35_0
   for-loop
   run-module-instance!
   perform-require!
raco setup: 5 running: /graph-doc/graph/scribblings/graph.scrbl
raco setup: 4 running: /htdp-doc/graphics/scribblings/graphics.scrbl
raco setup: 6 running: /gregor-doc/gregor/scribblings/gregor.scrbl
raco setup: 2 running: /gui-doc/scribblings/gui/gui.scrbl
raco setup: 0 running: 
/handin/handin-server/scribblings/handin-server.scrbl
raco setup: 4 running: /racket-doc/help/help.scrbl
raco setup: 4 running: /htdp-doc/htdp/htdp.scrbl
raco setup: 0 running: /htdp-doc/scribblings/htdp-langs/htdp-langs.scrbl
raco setup: 5 running: /htdp-doc/scribblings/htdp-langs/htdp-ptr.scrbl
raco setup: 5 running: /html-doc/html/html.scrbl
raco setup: 4 running: /html-parsing/html-parsing.scrbl
raco setup: 4 running: /http/http/http.scrbl
raco setup: 5 running: /images-doc/images/scribblings/images.scrbl
raco setup: 4 running: /racket-doc/scribblings/inside/inside.scrbl
raco setup: 3 running: /racket-doc/json/json.scrbl
raco setup: 3 running: /latex-pict/latex-pict/scribblings/latex-pict.scrbl
raco setup: 3 running: /lazy/lazy.scrbl
raco setup: 4 running: /levenshtein/levenshtein.scrbl
raco setup: 4 running: /racket-index/scribblings/main/license.scrbl
raco setup: 4 running: 
/racket-index/scribblings/main/user/local-redirect.scrbl
raco setup: 3 running: /macro-debugger/macro-debugger/macro-debugger.scrbl
raco setup: 4 running: /make/make.scrbl
raco setup: 6 running: /markdown/markdown/markdown.scrbl
raco setup: 4 running: /math-doc/math/scribblings/math.scrbl
raco setup: 6 running: /mcfly/mcfly.scrbl
raco setup: 6 running: /memoize/memoize/memoize.scrbl
raco setup: 6 running: /molis-hai/molis-hai/molis-hai.scrbl
raco setup: 7 running: /racket-doc/scribblings/more/more.scrbl
raco setup: 6 running: /gui-doc/mrlib/scribblings/mrlib.scrbl
raco setup: 2 running: /mysterx/scribblings/mysterx.scrbl
raco setup: 2 running: /mzcom/mzcom.scrbl
raco setup: 7 running: /compatibility-doc/mzlib/scribblings/mzlib.scrbl
raco setup: 2 running: /mzscheme-doc/mzscheme/mzscheme.scrbl
raco setup: 2 running: /net-doc/net/scribblings/net.scrbl
raco setup: 6 running: /racket-doc/openssl/openssl.scrbl
racket(52764,0x7ab17000) malloc: *** error for object 0x1735d8dc8: pointer 
being realloc'd was not allocated
racket(52764,0x7ab17000) malloc: *** set a breakpoint in malloc_error_break 
to debug
make[2]: *** [in-place-setup] Abort trap: 6
make[1]: *** [plain-in-place] Error 2
make: *** [in-place] Error 2
make  4947.41s user 1268.91s system 356% cpu 29:03.26 total


raco setup: 2 running: /mysterx/scribblings/mysterx.scrbl
raco setup: 2 running: /mzcom/mzcom.scrbl
raco setup: 7 running: /compatibility-doc/mzlib/scribblings/mzlib.scrbl
raco setup: 2 running: /mzscheme-doc/mzscheme/mzscheme.scrbl
raco setup: 

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

2020-03-20 Thread 'John Clements' via Racket Users
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 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 

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

2020-03-20 Thread 'John Clements' via Racket Users
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 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.
>>> 
>>> Hmm.
>>> 
>>> Well, here’s the code to reproduce this. Note that there’s an obvious 
>>> bug/assumption in that my code doesn’t account for any existing leading 
>>> spaces on a line, but none of my examples have leading spaces following 
>>> newlines.
>>> 
>>> Advice appreciated!
>>> 
>>> John
>>> 
>>> 
>>> 
>>> 

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

2020-03-20 Thread 'John Clements' via Racket Users
Unimportant thing one: this code had the same issue as mine, but as Robby 
points out, the issue is the way the text% is constructed; I was just creating 
a racket:text% directly, which (IIUC) doesn’t have a graphics context, so the 
auto-indenter can’t figure out how wide characters are.

Less unimportant thing: It seems like a whole bunch of people are writing 
racket linting/style-checking code right now, which seems like an unfortunate 
duplication of resources. I’ve got one that I’m about to deploy to my students 
that uses a combination of raw-text and read-but-not-expanded syntax, and right 
now it’s looking for simple things like functions without purpose statements, 
lines with only trailing parens, and uses of ‘cast’ that aren’t in fairly 
specific places (to wit, the bodies of functions named “parse”, a kind of 
ridiculous hack).

If you released your code, then we could all use it, and shower you day and 
night with bug reports and irritating feature requests!

John

> On Mar 20, 2020, at 12:21 PM, Benjamin Lerner  wrote:
> 
> In my auto-indenter and style checker (not yet a package that’s widely 
> available): evidently, there are some preferences that control which 
> constructs get tabified differently than expected. So I tweak those 
> preferences before invoking tabify-all. (In my case, I’m trying to support 
> two plausible indentation styles, depending on whether students have 
> different defaults set, so I compute the indentation twice.)
> 
> #lang racket
> 
> ;; Read in a source file and tabify it according to the following three 
> tabbing styles:
> ;;
> ;; 1. Untabbed (as writen directly in the file)
> ;; 2. Standard DrRacket tabbing excluding the big-bang default.
> ;;big-bang indents as:
> ;;  (big-bang a
> ;;b)
> ;; 3. Standard DrRacket tabbing including the big-bang default.
> ;;big-bang indents as:
> ;;  (big-bang a
> ;;b)
> ;;
> ;; (-> racket:text%? (values string? string? string?))
> ;;
> ;; WARNING!!! This function likely has effects based on the framework 
> library. It should NOT touch
> ;; your filesystem. However, this module should not be instantiated alongside
> ;; other DrRacket preferences.
> ;;
> (provide tabify-text)
> 
> (require framework/preferences)
> 
> (define (tabify-text t)
>   (parameterize* ([preferences:low-level-put-preferences
>(λ _ (void))]
>   [preferences:low-level-get-preference
>(λ _ #f)])
> (define untabbed (send t get-text))
> (define tabbed
>   (let ()
> (match-define (list table rx1 rx2 rx3 rx4)
>   (preferences:get 'framework:tabify))
> (hash-remove! table 'big-bang)
> (preferences:set 'framework:tabify
>  (list table rx1 rx2 rx3 rx4))
> (send t tabify-all)
> (send t get-text)))
> (define lambda-tabbed
>   (let ()
> (match-define (list table rx1 rx2 rx3 rx4)
>   (preferences:get 'framework:tabify))
> (hash-set! table 'big-bang 'lambda)
> (preferences:set 'framework:tabify
>      (list table rx1 rx2 rx3 rx4))
> (send t tabify-all)
> (send t get-text)))
> (values untabbed tabbed lambda-tabbed)))
> 
> On 3/20/20 3:12 PM, ‘John Clements’ via Racket Users 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 C

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

2020-03-20 Thread 'John Clements' via Racket Users
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 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.
>> 
>> Hmm.
>> 
>> Well, here’s the code to reproduce this. Note that there’s an obvious 
>> bug/assumption in that my code doesn’t account for any existing leading 
>> spaces on a line, but none of my examples have leading spaces following 
>> newlines.
>> 
>> Advice appreciated!
>> 
>> John
>> 
>> 
>> 
>> 
>> #lang racket
>> 
>> (require framework)
>> 
>> ;; given a string of racket text, return the corresponding indented 
>> string
>> ;; NB: CURRENTLY ASSUMES ALL LINES START WITH ZERO SPACES.
>> (define (string-indent text-to-indent)
>> (define t (new racket:text%))
>> (send t erase)
>> (send t insert text-to-indent 0)
>> (define num-paragraphs (add1 (send t last-paragraph)))
>> (define indents
>> (for/list ([n (in-range num-paragraphs)])
>>   

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

2020-03-20 Thread 'John Clements' via Racket Users
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.
 
 Hmm.
 
 Well, here’s the code to reproduce this. Note that there’s an obvious 
 bug/assumption in that my code doesn’t account for any existing leading 
 spaces on a line, but none of my examples have leading spaces following 
 newlines.
 
 Advice appreciated!
 
 John
 
 
 
 
 #lang racket
 
 (require framework)
 
 ;; given a string of racket text, return the corresponding indented string
 ;; NB: CURRENTLY ASSUMES ALL LINES START WITH ZERO SPACES.
 (define (string-indent text-to-indent)
 (define t (new racket:text%))
 (send t erase)
 (send t insert text-to-indent 0)
 (define num-paragraphs (add1 (send t last-paragraph)))
 (define indents
  (for/list ([n (in-range num-paragraphs)])
(define par-start (send t paragraph-start-position n))
(list par-start
  (send t compute-racket-amount-to-indent
par-start
head-sexp-type
 ;; NB: OBVIOUSLY WRONG, assumes all lines start with zero leading spaces:
 ;; act in reverse order, to avoid messing up the meaning of char posns:
 (for ([indent (in-list (reverse indents))])
  (send t set-position (first indent))
  (define space-string
(list->string (for/list ([i (in-range (second indent))]) #\space)))
  (send t insert space-string))
 (send t get-text))
 
 ;; for now, always return 'other
 (define (head-sexp-type str)
 'other)
 
 
 (define text-to-indent
 #<<|
 ;Closures help a function value remember what substitutions 

[racket-users] Test message sent to racket-users@googlegroups.com

2020-03-20 Thread 'John Clements' via Racket Users
Please ignore, 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/5ebd201a-8811-482a-b1a1-45a6c6b0d276%40mtasv.net.


Re: [racket-users] Lambda calculus done in Racket

2020-02-20 Thread 'John Clements' via Racket Users
I’m sure many other people have something like this, but here’s “Lab 5” from my 
currently-running PL course:

https://www.brinckerhoff.org/clements/2202-csc430/Labs/lab5.html

It introduces church numeral encodings and also this kind of true-false 
encoding as small programming challenges in Racket. It assumes that you already 
know how to program in Racket. It doesn’t go deep.

John

> On Feb 17, 2020, at 9:12 AM, Lawrence Bottorff  wrote:
> 
> I found these blowing down the sidewalk today
> 
> ; TRUE = λx.λy.x
> (define mytrue 
>   (lambda (t) (lambda (f) t)))
> 
> and 
> 
> ; FALSE = λx.λy.y
> (define myfalse
>   (lambda (t) (lambda (f) f)))
> 
> Two problems, I don't understand them and AFAICT, they don't work. I traced 
> them back to this post on stackoverflow. Can anyone get me started here?
> 
> LB
> 
> -- 
> 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/CAFAhFSXjQq2WWei8zvVY38cQmPd9Yb9sd95zCsszWY_aO3xPkA%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/525248ef-03a7-4e88-9ef8-507dd298e433%40mtasv.net.


Re: [racket-users] Web server + authentication

2020-02-15 Thread 'John Clements' via Racket Users
Wait, we *all* have postmark libraries? 

Sigh.

John

> On Jan 23, 2020, at 16:29, Jens Axel Søgaard  wrote:
> 
> Den tor. 23. jan. 2020 kl. 01.47 skrev Matthew Butterick :
> I concur on Postmark. For 2+ yrs I've used it with the Racket web server for 
> mbtype.com. I pass the server settings to `smtp-send-message` from `net/smtp`.
> 
>> On 22 Jan 20, at 3:00 AM, Bogdan Popa  wrote:
>> 
>> I like using Postmark[0] for this.  Their free plan lets you send up to
>> 100 e-mails a month, their paid plans come at a reasonable price and
>> they have helpful docs and validators to help you set up SPF, DMARC and
>> DKIM.
> Two recommendations!
> 
> I took a second look at Postmark and was impressed by their service,
> so I went ahead and added password recovery emails via Postmark.
> 
> Some nice features:
> - don't need to setup and maintain a mail server
> - weekly report on the "spam status" of your domain
> - email templates (html mails are hard)
> - an ios app to track mails
> - 100 mails free pr month (which for Racket Stories is plenty)
> 
> Thanks for the push.
> 
> 
> Stephen, I think, password resets were what you originally asked for (see 
> latest commit).
> 
>  https://github.com/soegaard/racket-stories
> 
> The code hasn't been deployed yet - it'll happen sometime tomorrow.
> 
> Philip: I'll keep your solution in mind, if I for some reason need to change 
> it.
> 
> /Jens Axel
> 
> 
> 
> 
> 
> -- 
> 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/CABefVgzNd2ZF1fpChjPKu9uYP1JambVJNzONUqKeTquPR-v2Lg%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/5614dc15-473c-4ff6-81a2-5c951cd8f919%40mtasv.net.


Re: [racket-users] resources for learning JS / React?

2020-02-15 Thread 'John Clements' via Racket Users
Belatedly: awesome, many thanks!

John

> On Jan 27, 2020, at 02:39, Sean Kemplay  wrote:
> 
> 
> This is a good (free) course that takes you the lates best practices of JS 
> (getting more functional), react and then react native.
> 
> https://www.edx.org/course/cs50s-mobile-app-development-with-react-native
> 
> 
> On Saturday, January 25, 2020 at 6:56:57 PM UTC, 'John Clements' via 
> users-redirect wrote:
> I have a graduate student that wants a self-guided introduction to JS and 
> React. The problem here, to some degree, is that there are so *many* 
> introductions. Does anyone here have specific references that might be 
> helpful? (Say, e.g., if Gregor Kiczales did a JS course on coursera… that 
> would be pretty much perfect.) 
> 
> 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/c433373a-3135-426d-90f3-f5d79032d38c%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/7b5f53bb-0401-4fc0-81e1-78dd375e88f4%40mtasv.net.


Re: [racket-users] Rolling dice game

2020-02-15 Thread 'John Clements' via Racket Users
Have you taken a look at How To Design Programs? At the end of section one, you 
should have what you need to build these games and others like them:

https://htdp.org/2019-02-24/part_one.html

John Clements

> On Feb 3, 2020, at 03:31, Wilzoo  wrote:
> 
> Hi guys, so I am working on rolling dice game in GUI, the game rules will be 
> something like rolling 3 dices and then giving out points to 2 players based 
> on the rolled values. 
> 
> Im now stuck on the showing value in GUI. Basically what I need is to show 
> rolled value somewhere in frame. 
> 
> This is my rolling dice code:
> 
> (define (nrandom n)
> (if (= n 0 ) '() (cons (random 1 7) (nrandom (- n 1)
> 
> this is my callback function which i know is wrong:
> 
> (new button% [parent gamew]
>  [label "roll dice"]
>  [min-width 150]
>  ; Callback procedure for a button click:
>  [callback (lambda (b e) (send (nrandom 3) show #t))])
> 
> So by using this im getting my 3 values in IDE window. Where should I look 
> for information how to get them in frame in some kind of box?
> 
> I just started my programming journey and racket documentation is not easy 
> for me to get any information from there tbh. Just figuring out how to make 
> frame and buttons + callback functions took me good few hours.
> 
> Thanks for help
> 
> 
> -- 
> 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/da23d01b-5422-4fe9-b40d-0ca9a904fed9%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/9c3d2a9a-a79d-47d6-b874-31a8dbb0d296%40mtasv.net.


Re: [racket-users] How to convert String to Integer

2020-02-15 Thread 'John Clements' via Racket Users
Did anyone suggest this code to you? Apologies if I’m re-treading an old 
conversation.

#lang typed/racket
(: string2value (-> String Integer))
(define (string2value str)
  (define maybe-integer (string->number str))
  (cond [(exact-integer? maybe-integer) maybe-integer]
[else (error 'string2value
 "expected a string convertible to an integer, got: ~e"
 str)]))


Best,

John Clements

> On Feb 15, 2020, at 10:37, 'John Clements' via Racket Users 
>  wrote:
> 
> ??
> 
>> (string2value "-1234")
> - : Integer
> -28766
>> (string2value "abcd")
> - : Integer
> 54562
>> 
> 
> Is this your desired behavior?
> 
>> On Feb 12, 2020, at 16:43, Alain De Vos  wrote:
>> 
>> I came to the following result as conversion function :
>> 
>> #lang typed/racket
>> (: string2value (-> String Integer))
>> (define (string2value astring)
>>  (define (fun [val : Char] [res : Integer])
>>(+ (* 10 res) (- (char->integer val) 48)))
>>  (foldl fun 0 (string->list astring))
>> )
>> (print (string2value "12345"))
>> 
>> 
>> 
>> On Tuesday, February 11, 2020 at 11:34:16 AM UTC+1, Alain De Vos wrote:
>> I tried the following function to conver a String to an Integer.
>> 
>> #lang typed/racket
>> (: myconversion (-> String Integer))
>> (define (myconversion str)
>>  (string->number str))
>> 
>> The error given is :
>> Type Checker: type mismatch
>>  expected: Integer
>>  given: (U Complex False) in: (string->number str)
>> 
>> I guess this is because a number is not an Integer.
>> 
>> How to proceed?
>> 
>> I found the following code on internet , but this looks like a real overkill 
>> for this simple problem ,
>> 
>> (: numerical-char->integer (->
>> Char
>>   Integer
>> ))
>> (define (numerical-char->integer char)
>> 
>> 
>> (let ([num (- (char->integer char) 48)]) ; 48 = (char->integer #\0)
>> 
>> 
>> (if
>> 
>> 
>> (or (< num 0) (> num 9))
>> 
>> 
>> (raise 'non-numerical-char #t)
>> 
>> num
>> )))
>> 
>> 
>> 
>> (: string->integer (->
>> String
>>   Integer
>> ))
>> (define (string->integer str)
>> 
>> 
>> (let ([char-list (string->list str)])
>> 
>> 
>> (if (null? char-list)
>> 
>> 
>> (raise 'empty-string #t)
>> 
>> 
>> (
>> foldl
>> 
>> (λ([x : Integer] [y : Integer])
>> 
>> 
>> (+ (* y 10) x))
>> 
>> 
>> 0
>> 
>> 
>> (map numerical-char->integer char-list)
>> 
>> 
>> -- 
>> 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/3e58a927-c05a-4688-984c-1750fb014624%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/f6d3c6ef-8779-4e91-956f-d82eb11b%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/450ccb56-b2ff-42c7-9df3-292f07151fd9%40mtasv.net.


Re: [racket-users] How to convert String to Integer

2020-02-15 Thread 'John Clements' via Racket Users
??

> (string2value "-1234")
- : Integer
-28766
> (string2value "abcd")
- : Integer
54562
> 

Is this your desired behavior?

> On Feb 12, 2020, at 16:43, Alain De Vos  wrote:
> 
> I came to the following result as conversion function :
> 
> #lang typed/racket
> (: string2value (-> String Integer))
> (define (string2value astring)
>   (define (fun [val : Char] [res : Integer])
> (+ (* 10 res) (- (char->integer val) 48)))
>   (foldl fun 0 (string->list astring))
> )
> (print (string2value "12345"))
> 
> 
> 
> On Tuesday, February 11, 2020 at 11:34:16 AM UTC+1, Alain De Vos wrote:
> I tried the following function to conver a String to an Integer.
> 
> #lang typed/racket
> (: myconversion (-> String Integer))
> (define (myconversion str)
>   (string->number str))
> 
> The error given is :
> Type Checker: type mismatch
>   expected: Integer
>   given: (U Complex False) in: (string->number str)
> 
> I guess this is because a number is not an Integer.
> 
> How to proceed?
> 
> I found the following code on internet , but this looks like a real overkill 
> for this simple problem ,
> 
> (: numerical-char->integer (->
>  Char
>Integer
> ))
> (define (numerical-char->integer char)
> 
>   
> (let ([num (- (char->integer char) 48)]) ; 48 = (char->integer #\0)
> 
> 
> (if
> 
>  
> (or (< num 0) (> num 9))
> 
>  
> (raise 'non-numerical-char #t)
> 
>  num
> )))
> 
> 
> 
> (: string->integer (->
>  String
>Integer
> ))
> (define (string->integer str)
> 
>   
> (let ([char-list (string->list str)])
> 
> 
> (if (null? char-list)
> 
> 
> (raise 'empty-string #t)
> 
> 
> (
> foldl
>  
> (λ([x : Integer] [y : Integer])
> 
>
> (+ (* y 10) x))
> 
>  
> 0
> 
>  
> (map numerical-char->integer char-list)
> 
> 
> -- 
> 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/3e58a927-c05a-4688-984c-1750fb014624%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/f6d3c6ef-8779-4e91-956f-d82eb11b%40mtasv.net.


Re: [racket-users] resources for learning JS / React?

2020-01-26 Thread 'John Clements' via Racket Users
Many thanks! These look good.

John Clements

> On Jan 26, 2020, at 05:15, Darren Newton  wrote:
> 
> For learning JavaScript these two resources are very good:
> 
> Eloquent JavaScript https://eloquentjavascript.net/
> You Don't Know JS https://github.com/getify/You-Dont-Know-JS
> 
> The tutorial on the React site itself is pretty good and provides a solid 
> foundation in the framework - https://reactjs.org/tutorial/tutorial.html
> 
> 
> 
> On Saturday, January 25, 2020 at 1:56:57 PM UTC-5, 'John Clements' via 
> users-redirect wrote:
> I have a graduate student that wants a self-guided introduction to JS and 
> React. The problem here, to some degree, is that there are so *many* 
> introductions. Does anyone here have specific references that might be 
> helpful? (Say, e.g., if Gregor Kiczales did a JS course on coursera… that 
> would be pretty much perfect.) 
> 
> 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/4dc7e361-7ea1-490a-993a-210a364c70f7%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/f244ae71-9d34-4c23-aaf7-3fe931efd392%40mtasv.net.


[racket-users] style guide addition?

2020-01-20 Thread 'John Clements' via Racket Users
I’m grading code, and one of my students keeps leaving out spaces in weird 
places:

(cond
  [(< x 3)(+ x 1)]
  [else (f(g 9))])

I took a quick look in the style guide, and it doesn’t seem to have much to say 
about this. Here’s what it has:

6.8 Spaces

Don’t pollute your code with spaces at the end of lines.

If you find yourself breaking long blocks of code with blank lines to aid 
readability, consider refactoring your program to introduce auxiliary functions 
so that you can shorten these long blocks of code. If nothing else helps, 
consider using (potentially) empty comment lines.

***

To this text, I would like to add:

“Every pair of expressions on a line should have at least one space between 
them, even if they’re separated by parens.

Wrong: [(< x 3)(+ x 1)]
Right: [(< x 3) (+ x 1)]

Wrong: (f(g 3))
Right: (f (g 3))


Can anyone think of exceptions to this? One possible nit: since the rule refers 
to “expressions”, it perhaps wouldn’t rule out (define(f x)3) . You could say 
“term”, but I think it would be less clear.

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/22028833-9d60-4d2e-9c6b-ae35d55abdf0%40mtasv.net.


Re: [racket-users] index-of + TR ... parametricity problem?

2019-12-15 Thread 'John Clements' via Racket Users
Oh! of course. Makes sense. 

If I make a pull request, does that mean I get a pass for wasting my time doing 
advent of code?

John

> On Dec 15, 2019, at 18:41, Sam Tobin-Hochstadt  wrote:
> 
> Yes, this is because the contract enforces parametericity, which
> doesn't allow `index-of` to work the way you'd want.
> 
> Instantiating things doesn't help because the contract is based on the
> `require/typed`, not on the use site.
> 
> Here's a few suggestions:
> 
> 1. Submit a pull-request to TR to add `index-of`
> 2. Import `index-of` at a concrete type
> 3. Use `unsafe-require/typed`
> 4. Use the third argument to `index-of?`
> 
> Sam
> 
> On Sun, Dec 15, 2019 at 9:28 PM 'John Clements' via Racket Users
>  wrote:
>> 
>> It looks like my quick attempt at importing index-of into TR is running into 
>> a problem. Here’s the program I ran:
>> 
>> #lang typed/racket
>> 
>> (require/typed racket/list
>>   [index-of (All (T) ((Listof T) T -> (U False Natural)))])
>> 
>> (index-of '(n s e w) 'n) ;; returns... #f?
>> 
>> In typed/racket/no-check this returns 0, and also in racket (mutatis 
>> mutandis).
>> 
>> I thought this might be some kind of parametricity issue, but even when I 
>> instantiate index-of at Symbol which should pretty much clear the way for 
>> arbitrary equality checking, I still get False.
>> 
>> Am I missing something obvious? Maybe I shouldn’t be running from the 
>> November 14 git head any more?
>> 
>> Welcome to DrRacket, version 7.5.0.7--2019-11-14(-/f) [3m].
>> 
>> 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/ef401a3d-9c41-44f9-ba61-93c09065755e%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/9a289e18-2d8c-46b9-8e80-8add6c16e402%40mtasv.net.


[racket-users] index-of + TR ... parametricity problem?

2019-12-15 Thread 'John Clements' via Racket Users
It looks like my quick attempt at importing index-of into TR is running into a 
problem. Here’s the program I ran:

#lang typed/racket

(require/typed racket/list
   [index-of (All (T) ((Listof T) T -> (U False Natural)))])

(index-of '(n s e w) 'n) ;; returns... #f?

In typed/racket/no-check this returns 0, and also in racket (mutatis mutandis). 

I thought this might be some kind of parametricity issue, but even when I 
instantiate index-of at Symbol which should pretty much clear the way for 
arbitrary equality checking, I still get False.

Am I missing something obvious? Maybe I shouldn’t be running from the November 
14 git head any more? 

Welcome to DrRacket, version 7.5.0.7--2019-11-14(-/f) [3m].

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/ef401a3d-9c41-44f9-ba61-93c09065755e%40mtasv.net.


Re: [racket-users] Playing with rsound

2019-12-07 Thread 'John Clements' via Racket Users
The problem here is that the piano notes are not all the same duration. 
Specifically, your chord  (chord 60 64 67) is a bit longer:

(rs-frames (chord 60 64 67)) -> 161634 frames
(rs-frames (piano-tone 72)) -> 144000 frames

There are a lot of ways of solving this, including clipping the two sounds to 
the same length and using the `assemble` function. but here’s one simple way:


(require rsound)
(require rsound/piano-tones)
(define (chord . notes)
  (rs-overlay* (map piano-tone notes)))
(play (rs-append (rs-overlay (chord 60 64 67)
(piano-tone 72))
 (rs-overlay (chord 60 65 69)
(piano-tone 72))
 (rs-overlay (chord 62 67 71)
(piano-tone 74))
 (rs-overlay (chord 64 67 72)
(piano-tone 84


(that is, put the append on the outside, and the rs-overlays inside it.)

(Also, yes, I made it a little I-IV-V-I instead of the same chord twice.)

John



> On Dec 7, 2019, at 14:39, wanderley.guimar...@gmail.com wrote:
> 
> I started to playing around with rsound while reading its documentation.  I 
> wrote the following code:
> 
> #lang racket
> (require rsound)
> (require rsound/piano-tones)
> (define (chord . notes)
>   (rs-overlay* (map piano-tone notes)))
> (play (rs-overlay (rs-append (chord 60 64 67)
>  (chord 60 64 67))
>   (rs-append (piano-tone 72)
>  (piano-tone 72
> 
> and I was expecting to hear `(piano-tone 72)` on the begin of the two chords. 
>  The second `(piano-tone 72)` starts few milliseconds after the second chord 
> starts.
> 
> Can you help me understand why this is happening?
> 
> Thanks,
> wander
> 
> -- 
> 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/CAAmHZodfci0HM0_b%2BPaEuGBojyJsKwOhDKd-%2Bgi3jJHhaHi7Hg%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/30767f0b-2fd3-480f-a350-9b4f32305498%40mtasv.net.


Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-12-03 Thread 'John Clements' via Racket Users



> On Dec 3, 2019, at 2:29 PM, James Platt  wrote:
> 
> 
> On Nov 27, 2019, at 12:42 PM, Darth Vadør wrote:
> 
>> I am having the same problem, and I am pretty sure that this is because the 
>> new DMG uses the novel APFS format, which is not readable by our old HFS 
>> computers. 
>> As far as I know, HFS DMGs can be opened on new APFS Macs; would it be 
>> possible / a good idea to keep distributing Racket on an HFS DMG for our 
>> dinosaur machines? 
> 
> APFS has a number of new and improved features but I don't think any of them 
> are really important for a software distribution archive.  Note that macOS 
> does have zip built in.  As I understand it, the reason for dmg as the 
> official distribution format is just that it is supposed to have superior 
> integrity checking compared to zip.

It sounds to me like an easy solution to your problems would be a .tgz-bundled 
set, as e.g. we offer for Minimal Racket on the page

https://download.racket-lang.org/releases/7.5/

specifically at the link 

https://download.racket-lang.org/releases/7.5/installers/racket-minimal-7.5-x86_64-macosx.tgz

It looks to me like it would be fairly easy to generate this bundle for full 
racket, unless I’m missing something obvious. It would presumably appear on the 
“More Variants and Checksums” page along with the other tarballs. Is this 
something you’d like to see happen for the 7.6 release?

As far as the choice of .dmg for the standard distribution, it has two 
advantages that I’m aware of:
1) It allows us to create a easy installation path by specifying the way the 
disk window should look when we open it, as opposed to having an installer, and
2) It’s natively supported by Apple’s notarization workflow; I know that .tgz 
files don’t work, and I suspect that .zip files wouldn’t work either, though 
that’s just a guess.

John



> 
>> 
>> Long live 10-year-old Macs
> 
> Indeed.  The 2009 Mac Pro which I am using right now is among most likely 
> machines to be in use by the people who my company is developing software for 
> in Racket.  This Mac Pro, running El Capitan (macOS 10.11), is not just a 
> workable machine.  It's still a powerful machine by todays standards.  El 
> Capitan is the highest OS officially supported but it can run High Sierra 
> (10.13) just fine in VMWare.  Having said that, we also need to support the 
> newest machines so I will probably try setting up a VM with an even newer OS 
> or buy whatever is the cheapest laptop that can run Catalina.  For the Mac 
> Pro, I am considering installing Linux and running macOS only in virtual 
> machines.
> 
> If you want to test that the issue really is APFS then you might consider 
> installing a High Sierra (or possibly later) virtual machine.  High Sierra, 
> and up, can read APFS.
> 
> -- 
> 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/1934E9FC-CE39-4C4E-BF3A-0DC37DBA2509%40biomantica.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/6c748e88-faea-4dfc-985d-84d28b09e7be%40mtasv.net.


Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-11-27 Thread 'John Clements' via Racket Users
Well, actually, I would try just running the binaries, first; it may well be 
that 10.11 doesn’t require the manual deletion of the quarantine flags.

You can also try using a right-click and choosing “open” from the menu; this 
clears the quarantine flag in many cases.

If it does turn out to be necessary, the command is

xattr -d com.apple.quarantine 

… IIRC.  You’ll probably need to run this on (at least) two targets: the 
DrRacket.app directory, and the racket binary in the bin/ directory.

John

> On Nov 27, 2019, at 11:30, Bruce O'Neel  wrote:
> 
> 
> 
> Hi,
> 
> What would be the magic xattr command?
> 
> Thanks.
> 
> bruce
> 
> 27 November 2019 20:26 "'John Clements' via Racket Users" 
>  wrote:
> This is 100% workaround rather than a fix, but have you considered using the 
> minimal racket tarball:
> 
> https://download.racket-lang.org/releases/7.5/installers/racket-minimal-7.5-x86_64-macosx.tgz
> 
> …and then manually blessing the binaries using xattr and then installing the 
> rest of the system manually using raco pkg install?
> 
> John
> 
> 
> 
> > On Nov 27, 2019, at 09:42, Darth Vadør wrote:
> >
> > I am having the same problem, and I am pretty sure that this is because the 
> > new DMG uses the novel APFS format, which is not readable by our old HFS 
> > computers.
> > As far as I know, HFS DMGs can be opened on new APFS Macs; would it be 
> > possible / a good idea to keep distributing Racket on an HFS DMG for our 
> > dinosaur machines?
> >
> > Long live 10-year-old Macs,
> > Louis
> >
> > On Monday, November 25, 2019 at 8:22:36 PM UTC+1, David Storrs wrote:
> > When I download and install the .dmg file from racket-lang, I'm told "no 
> > mountable filesystems". I'm not sure if this is an issue with how it was 
> > built, with my machine, or with OSX in general.
> >
> > This may not be worth worrying about, since OSX 10.11 was released
> > September 30, 2015 and Apple has decided that something from four years ago 
> > is FAR too old to worry about backwards compatibility. (grumble, grumble)
> >
> > --
> > 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/f7cb5f96-783d-475b-a5d2-390668665217%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/fe9f2f3c-e133-4489-980b-213b976764ee%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/3d8981a5-2e84-464d-bcdf-56a723e0ad13%40mtasv.net.


Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-11-27 Thread 'John Clements' via Racket Users
This is 100% workaround rather than a fix, but have you considered using the 
minimal racket tarball:

https://download.racket-lang.org/releases/7.5/installers/racket-minimal-7.5-x86_64-macosx.tgz

…and then manually blessing the binaries using xattr and then installing the 
rest of the system manually using raco pkg install?

John



> On Nov 27, 2019, at 09:42, Darth Vadør  wrote:
> 
> I am having the same problem, and I am pretty sure that this is because the 
> new DMG uses the novel APFS format, which is not readable by our old HFS 
> computers. 
> As far as I know, HFS DMGs can be opened on new APFS Macs; would it be 
> possible / a good idea to keep distributing Racket on an HFS DMG for our 
> dinosaur machines? 
> 
> Long live 10-year-old Macs, 
> Louis
> 
> On Monday, November 25, 2019 at 8:22:36 PM UTC+1, David Storrs wrote:
> When I download and install the .dmg file from racket-lang, I'm told "no 
> mountable filesystems".  I'm not sure if this is an issue with how it was 
> built, with my machine, or with OSX in general.
> 
> This may not be worth worrying about, since OSX 10.11 was released
> September 30, 2015 and Apple has decided that something from four years ago 
> is FAR too old to worry about backwards compatibility. (grumble, grumble)
> 
> -- 
> 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/f7cb5f96-783d-475b-a5d2-390668665217%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/fe9f2f3c-e133-4489-980b-213b976764ee%40mtasv.net.


[racket-users] Racket v7.5

2019-11-19 Thread 'John Clements' via Racket Users
Racket version 7.5 is now available from

https://racket-lang.org/

* Almost all of Racket version 7.5 is distributed under a new,
  less-restrictive license: either the Apache 2.0 license or the MIT
  license. See 
https://blog.racket-lang.org/2019/11/completing-racket-s-relicensing-effort.html
  for more details.

* Racket CS remains "beta" quality for the v7.5 release, but its
  compatibility and performance continue to improve. We expect that it
  will be ready for production use by the next release. We encourage you
  to check how well the v7.5 CS release works for your programs, and
  help push the project forward by reporting any problems that you find.

* The Web Server provides a standard JSON MIME type, including a
  response/jsexpr form for HTTP responses bearing JSON.

* GNU MPFR operations run about 3x faster.

* Typed Racket supports definitions of new struct type properties and
  type checks uses of existing struct type properties in struct
  definitions. Previously, these uses were ignored by the type checker,
  so type errors there may have been hidden.

* The performance bug in v7.4’s big-bang has been repaired.

* DrRacket supports Dark Mode for interface elements.

* Plot can display parametric 3d surfaces.

* Redex supports modeless judgment forms.

* MacOS 10.15 (Catalina) includes a new requirement that executables be
  "notarized", to give Apple the ability to prevent certain kinds of
  malware. In this release, all of the disk images (.dmg's) are
  notarized, along with the applications that they contain
  (.app's). Many users may not notice any difference, but two groups of
  Catalina users will be affected: those that use the "racket" binary
  directly, and those that download the ".tgz" bundles. In both cases,
  the operating system is likely to inform you that the given executable
  is not trusted, or that the developer can't be verified. Fortunately,
  both groups of users are probably also running commands at in a shell,
  and the solution for both groups is the same: you can disable the
  quarantine flag using the `xattr` command, e.g.

  xattr -d com.apple.quarantine /path/to/racket

  TL;DR: Everything is fine. Read this note again if you run into problems.

The following people contributed to this release:

Alex Knauth, Alexander Shopov, Alexis King, Ayman Osman, Ben Greenman,
Bert De Ketelaere, Bogdan Popa, Caleb Allen, Chuan Wei Foo, David
Florness, Diego A. Mundo, Dominik Pantůček, Fred Fu, Geoffrey Knauth,
Gregory Cooper, Gustavo Massaccesi, James Bornholt, Jay McCarthy, Jens
Axel Søgaard, Jesse A. Tov, Jesse Alama, John Clements, Jon Zeppieri,
Leo Uino, Luke Nelson, Matthew Flatt, Matthias Felleisen, Max New, Mike
Sperber, Nick Thompson, Noah W M, Paulo Matos, Philip McGrath, Robby
Findler, Ryan Culpepper, Sam Tobin-Hochstadt, Shu-Hung You, Sorawee
Porncharoenwase, Stephen Chang, Thomas Dickerson, and William J. Bowman


Feedback Welcome



-- 
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/80893e1c-e858-4423-86a0-218700225bf0%40mtasv.net.


Re: [racket-users] How to install an updated version of an installation-wide package?

2019-11-05 Thread 'John Clements' via Racket Users
It looks to me like you’re looking for “raco pkg update —clone” or “raco pkg 
update —link”, but I may be mistaken.

Specifically, running 

raco pkg update —clone drracket

in, say, your home directory should clone the package that includes the 
drracket collection (and possibly others that are in the same package). After 
this is complete, your drracket should depend on this version of the 
collection, rather than the installed one.

Apologies in advance if I’ve misunderstood your problem.

Best,

John Clements

> On Nov 5, 2019, at 10:18 AM, 'Reuben Thomas' via Racket Users 
>  wrote:
> 
> I'm trying to make a small improvement to the drracket package, and of course 
> I'd like to test it!
> 
> I have racket 7.4 installed on my Ubuntu system from the PPA, so of course 
> drracket is installed as part of the installation.
> 
> After reading the "raco pkg" docs, and searching the mailing list, I can't 
> figure out how to make a user installation of the drracket package so I can 
> test it. My best attempt so far is something like:
> 
> raco pkg install ./drracket
> raco pkg install: package is currently installed in a wider scope
>   package: drracket
>   installed scope: installation
>   given scope: user
> 
> Of course, I don't want to overwrite the installation's version of drracket, 
> I just want a user installation that takes precedence.
> 
> I'm a total newbie with raco, so sorry if I've overlooked something obvious.
> 
> -- 
> 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/2e5eee6b-2081-464a-b780-e9a8c65fc269%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/86eda28e-476c-4b8f-a2ac-dcf5f3e38f9d%40mtasv.net.


Re: [racket-users] Version number issue with snapshot 7.5.0.6

2019-11-04 Thread 'John Clements' via Racket Users
Forgive me if I’m missing something important, but I see messages like this all 
the time when I’m using two installations of racket simultaneously on one 
machine. It suggests to me that you need to recompile using a raco make, or 
just delete the compiled files. Again, apologies if I’m misunderstanding your 
issue!

John Clements

> On Nov 4, 2019, at 08:30, David Storrs  wrote:
> 
> read-compiled-linklet: version mismatch  expected: "7.5.0.5"  found:
> "7.5.0.6"  in: 
> /Applications/snapshot_Racket_v7.5.0.6/collects/racket/compiled/main_rkt.zo
> 
> I'm on OSX 10.11.6 if that matters.
> 
> -- 
> 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/CAE8gKocTtpS1LJMJ_v1XHpoCFUFdUyyshU1a-MgQFjxhxdmwiw%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/caf3b8b1-bd4c-4d11-9a3a-cc135d75858e%40mtasv.net.


Re: [racket-users] broken download link

2019-10-22 Thread 'John Clements' via Racket Users
hmm, I don’t see that. Perhaps it’s already been fixed? If this persists for 
you, maybe you can show the output of 

curl -v -o “/tmp/index.html” “https://download.racket-lang.org/“

?

> On Oct 22, 2019, at 2:28 PM, calvin tolman  wrote:
> 
> fyi:
> 
> this url is broken:  https://download.racket-lang.org/
> 
> it returns a UofU 404 sort of page for this url: 
> https://www.cs.utah.edu/plt/download-racket-lang-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/f5696ee2-7deb-4664-97be-388e65ed5a0d%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/d35aecb4-a669-4e3f-af2b-e3afc13b2412%40mtasv.net.


Re: [racket-users] Interactive Heat Maps

2019-09-25 Thread 'John Clements' via Racket Users
Nice! Many thanks for sharing this.

John

> On Sep 21, 2019, at 2:06 AM, Alex Harsanyi  wrote:
> 
> A few days ago I posted about adding maps to the DrRacket REPL -- while a 
> nice demo, this is not why I implemented the `map-snip%` object.  The reason 
> I implemented it is because I wanted to add maps to an interface which was 
> designed for displaying plots produced by `plot-snip`.   While this is not 
> technically a racket topic, the application itself is written in Racket and I 
> think it is a nice showcase of Rackets' GUI capabilities, so here is a demo:
> 
> https://youtu.be/5Op6ywIqTRc
> 
> There is quite lot going  on "behind the scenes" here, and I covered some of 
> the topics in this blog post, but if you have any questions I am happy to 
> answer them: https://alex-hhh.github.io/2019/09/interactive-heat-maps.html
> 
> 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-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/ce9135a4-f317-4d6c-a3b7-eb2de88dc310%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/39154918-f423-483c-9e2e-d5e5c92efa43%40mtasv.net.


Re: [racket-users] no TR support for streams?

2019-09-10 Thread 'John Clements' via Racket Users
Oh! and in fact, you already bundled it as a pkg: 
https://pkgs.racket-lang.org/package/typed-racket-stream

Thanks!

John

> On Sep 7, 2019, at 2:23 PM, Alex Knauth  wrote:
> 
> 
>> On Sep 6, 2019, at 1:04 PM, 'John Clements' via Racket Users 
>>  wrote:
>> 
>> Perhaps I just don’t know how to search the racket docs correctly, but IIUC 
>> there’s no support for Streams in the current TR implementation? I just want 
>> to use stream-cons, empty-stream, stream-first, and stream-rest. I guess the 
>> easy workaround is just to use thunks to roll my own stream, but I’m 
>> wondering if I’m missing something obvious?
> 
> You can wrap `stream-cons`, etc. in contracts and keep the original stream 
> data type, but it's trickier than wrapping a normal function, and involves:
>  - an untyped file which imports the macros and exports "function-ized" 
> versions of the macros
>  - a typed file which imports those function-ized things with require/typed, 
> then exports new versions of the macros in terms of the functions
> 
> And looks something like like these two files:
> ; untyped-stream-function-ized.rkt
> #lang racket
> (provide stream-cons/fn)
> (require racket/stream)
> (define (stream-cons/fn a b)
>   (stream-cons (a) (b)))
> 
> ; typed-stream.rkt
> #lang typed/racket
> (provide stream-cons)
> (require/typed "untyped-stream-function-ized.rkt"
>   [stream-cons/fn (All (a) (-> (-> a) (-> (Sequenceof a)) (Sequenceof a)))])
> (define-simple-macro (stream-cons a b)
>   (stream-cons/fn (thunk a) (thunk b)))
> 
> This is the strategy I used for my `typed-racket-stream` repository:
> https://github.com/AlexKnauth/typed-racket-stream
> 
> I wanted to do this instead of "rolling my own" stream library because I 
> wanted to be able to share the same stream data-structure as existing untyped 
> racket files.
> 
> Alex Knauth
> 
> 
> -- 
> 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/50960124-B18A-445F-9511-5899E60D9A86%40knauth.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/2102ff51-b1e3-49a8-8348-c023dc83d960%40mtasv.net.


[racket-users] no TR support for streams?

2019-09-06 Thread 'John Clements' via Racket Users
Perhaps I just don’t know how to search the racket docs correctly, but IIUC 
there’s no support for Streams in the current TR implementation? I just want to 
use stream-cons, empty-stream, stream-first, and stream-rest. I guess the easy 
workaround is just to use thunks to roll my own stream, but I’m wondering if 
I’m missing something obvious?

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/e689a110-fe59-4a23-9dc6-185bbf9d2d09%40mtasv.net.


[racket-users] gen:stream doc fix?

2019-08-26 Thread 'John Clements' via Racket Users
The gen:stream documentation has this example:


(define-struct list-stream (v)
#:methods gen:stream
[(define (stream-empty? stream)
   (empty? (list-stream-v stream)))
 (define (stream-first stream)
   (first (list-stream-v stream)))
 (define (stream-rest stream)
   (rest (list-stream-v stream)))])

I believe this example is broken in a sneaky way; the “stream-rest” operation 
returns a simple list rather than a list-stream. This happens to “work” wrt 
things like stream-rest and stream-first because lists are also streams. I 
claim that this should instead read:


(define-struct list-stream (v)
#:methods gen:stream
[(define (stream-empty? stream)
   (empty? (list-stream-v stream)))
 (define (stream-first stream)
   (first (list-stream-v stream)))
 (define (stream-rest stream)
   (list-stream (rest (list-stream-v stream])

Can someone confirm that this is just a typo?

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/707f6164-d28e-4191-bf13-313edac3d5f0%40mtasv.net.


Re: [racket-users] [standard-fish] A geometric design

2019-08-25 Thread 'John Clements' via Racket Users
Seriously! Magnificent!

Want to play with this code, show it to students and co-workers.

John

> On Aug 25, 2019, at 14:52, Zachary Romero  wrote:
> 
> Hello,
> 
> Here is a little tessellation design I made along with some helper functions 
> to generate them: https://github.com/zkry/tessellation . I'm new to Racket 
> and this was a great chance to practice. Thanks for this idea! 
> 
> -- Zac
> 
> -- 
> 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/99e55f45-1031-43fd-9d33-054359b944a6%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/4118008d-0404-4cfa-81c4-f07407ebed45%40mtasv.net.


Re: [racket-users] running the wrong sqlite3

2019-08-20 Thread 'John Clements' via Racket Users
In that case, perhaps you can watch the calls to dlopen with strace? See 

https://stackoverflow.com/questions/5103443/how-to-check-what-shared-libraries-are-loaded-at-run-time-for-a-given-process

for something that might be helpful. 

John

> On Aug 20, 2019, at 11:30, James Platt  wrote:
> 
> 
> On Aug 19, 2019, at 9:24 PM, John Clements wrote:
> 
>> Perhaps you need to configure your lib-search-dir setting?
>> 
>> https://docs.racket-lang.org/raco/config-file.html?q=lib-search-dir#%28idx._%28gentag._65._%28lib._scribblings%2Fraco%2Fraco..scrbl%29%29%29
> 
> Thanks for the help but I think that's not the issue because 
> (get-lib-search-dirs) returns exactly the same thing on a machine where this 
> is working perfectly as on the machine where it isn't.  The machine where it 
> is not working is a virtual machine with a stock install of macOS High Sierra 
> and a relatively fresh install of Racket.  This VM is meant for development 
> and testing.   This particular clone of the reference VM has been used for a 
> little while but it should still be close to the reference.  So, on the one 
> hand, it's surprising that this is happening here, with something so close to 
> stock configuration.  On the other hand, the machine where it is working has 
> been beaten into submission to run all kinds of development tools over a 
> period of years.  
> 
> -- 
> 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/91E6919B-7066-4550-B394-0FA66886A6B0%40biomantica.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/433b3b19-e6ef-43b6-957f-e58da37675f6%40mtasv.net.


Re: [racket-users] [standard-fish] map of the world

2019-08-19 Thread 'John Clements' via Racket Users
agreed, very cool. Tempted to mess with projections.

John

> On Jul 31, 2019, at 10:45, Stephen De Gabrielle  
> wrote:
> 
> Very nice! Thank you so much!
> 
> Looks like an opportunity for some remixing :o
> 
> S.
> 
> On Wed, 31 Jul 2019 at 01:58, Alex Harsanyi  wrote:
> Here is a map of the world, rendered using a 40 line Racket program and 
> country outline data from https://geojson-maps.ash.ms/.  You can find the 
> source here: https://gist.github.com/alex-hhh/2c0f5a02d9e795cbedf90cf84ef84281
> 
> 
> 
> The program is similar to the one described here, which contains more details 
> about the map rendering: 
> https://alex-hhh.github.io/2019/05/timezone-visualization.html
> 
> 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-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/926f6bd8-8fa9-4047-9820-046fa1a55687%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/CAGHj7-L%3Dv9G2HbnCd5DZSs0v0_hwk2UTdaVv08LBu%3DVZ4rw1vQ%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/c4630a10-1d35-4c5c-a75b-c69548d775e2%40mtasv.net.


Re: [racket-users] acceptable drracket definitions for interaction

2019-08-19 Thread 'John Clements' via Racket Users
Are you referring to section 6.3, which defines modules as individual 
s-expressions?

It appears to me that this code would work fine if specified in the style shown 
earlier in section 6.1, where each module appears in its own file, begins with 
a #lang declaration, and the one referred to the other one using the name of 
the file in quotes. This would match the most common case of code development, 
where each module is contained in its own file.

However, you can certainly put both of them into one buffer, if that’s actually 
what you want. Use a #lang declaration at the top to implicitly wrap the whole 
file in a single module, making these two submodules, like this:

#lang racket

(module increment racket
(provide increment)
  
; increment : exact-integer? -> exact-integer?
(define (increment x) "this is broken"))

(module client typed/racket
  
(require/typed (submod ".." increment) [increment (-> Integer Integer)])
  
(increment 5))

(require ‘client)

Honestly, though, I would urge you to adopt the two-files style unless you have 
a really compelling reason not to.

John



> On Aug 14, 2019, at 11:47, rick  wrote:
> 
> Hello Racketeers,
> 
> I am brand new to Racket. I am interested in Blame Calculus and Gradual Types.
> 
> Thanks for all the great work.
> 
> I have successfully validated the interaction increment example [1] in 
> DrRacket. However, running the combined modules in the definitions window 
> reports that there can only be one expression in the definitions window.
> 
> How can I load both modules in the definitions window, so I don't have to 
> keep pasting them into REPL?
> 
> Thanks in advance for your help and thanks again for all the great work on 
> Racket.
> 
> 
> 1. https://docs.racket-lang.org/ts-guide/typed-untyped-interaction.html
> 
> -- 
> rick
> 
> -- 
> 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/dfc48fe3-10e9-0461-89e7-51a03a6207e5%40rickmurphy.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/04d6009f-da88-4b9c-a173-67feef3d9b0e%40mtasv.net.


Re: [racket-users] does handin-server really need racket/gui/base?

2019-08-19 Thread 'John Clements' via Racket Users
I’m not looking at the code here, but I believe the issue here is that the 
handin-server receives user code in a serialized-could-contain-images-format 
that can’t be decoded properly without importing the gui libraries.

It seems not implausible to me that you could special-case all-text submissions 
to build a handin-server that doesn’t require the gui pieces.

BUT,

I’m here to tell you that I also run the handin server on a headless UNIX 
system (currently Debian 9) with no problems.

Specifically, I use tigervnc to create an x session, then connect to it 
remotely (using a local vnc client) and start the handin server with an active 
X connection.

Let me know if you need more clues on this setup; there are a whole bunch of 
things that can go wrong.

John


> On Aug 16, 2019, at 22:00, 'Wayne Harris' via Racket Users 
>  wrote:
> 
> I tried the handin-server on a Windows computer and it worked just
> fine.  Now I'm trying it on a headless UNIX system and, upon first run,
> I got:
> 
> $ racket -l handin-server
> Unable to init server: Could not connect: Connection refused
> Gtk initialization failed for display ":0"
>   context...:
>"/usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/queue.rkt": [running 
> body]
>temp37_0
>for-loop
>run-module-instance!125
>for-loop
>[repeats 1 more time]
>run-module-instance!125
>for-loop
>[repeats 1 more time]
>run-module-instance!125
>do-dynamic-require5
>"/usr/share/racket/pkgs/gui-lib/mred/private/wx/platform.rkt": [running 
> body]
>temp37_0
>for-loop
>run-module-instance!125
>for-loop
>...
> 
> Then taking a peek at
> 
>   ~/.racket/7.2/pkgs/handin/handin-server/main.rkt
> 
> I saw
> 
>   (require ...
>  ;; workaround for a confusing problem: without this, the gui
>  ;; gets initialized in a handler (since checks use it, and
>  ;; they're being required dynamically), and further handlers
>  ;; will fail with "queue-callback: eventspace is shutdown",
>  ;; requiring it here makes it avoids killing the eventspace
>  racket/gui/base)
> 
> Just to see what happens, I commented out the racket/gui/base
> requirement and the server ran, but the comment says there'll be a
> confusing problem.
> 
> $ racket -l handin-server
> [-|2019-08-17T01:52:22] *** embedded web server started
> [-|2019-08-17T01:52:22] Cleaning up all submission directories
> [-|2019-08-17T01:52:22] *** handin server started on port 7979
> 
> Why does the server need anything GUI-related?  How do you run this
> server in production?
> 
> -- 
> 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/RxyC6B4i7HgNSuVjlatCo9H-fgEEC2x2L38zkodCjrx8FqWGGkkBEIhW-ndhGc-ieeByffOnG81S9kvYd-PHt1J5wfO1cTvZko8OgqCdXL8%3D%40protonmail.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/256a538d-7def-4f61-ae1c-bc9715ae1f58%40mtasv.net.


Re: [racket-users] running the wrong sqlite3

2019-08-19 Thread 'John Clements' via Racket Users
Perhaps you need to configure your lib-search-dir setting?

https://docs.racket-lang.org/raco/config-file.html?q=lib-search-dir#%28idx._%28gentag._65._%28lib._scribblings%2Fraco%2Fraco..scrbl%29%29%29

John

> On Aug 19, 2019, at 15:42, James Platt  wrote:
> 
> I'm having an issue where I can't seem to get Racket to run the right version 
> of sqlite3.  At least, I'm assuming that's the problem because the syntax 
> error below occurs in an older version but not the current version of 
> sqlite3.  My Terminal command path has the correct version.  What can I do to 
> make sure Racket is using the right version?
> 
> 
> Here's the full error message.
> 
> RUNNING reset_dbs.rkt
> rows are: '(#hash((data . #hasheq((base_dir . "/tmp/biomantica"))) (name . 
> "filesystem")))
> SQL:
> INSERT INTO config ( name, data ) VALUES ($1,$2) ON CONFLICT DO NOTHING  
> vals: 
> '("filesystem" "{\"base_dir\":\"/tmp/biomantica\"}")
> query-exec: near "ON": syntax error
>  error code: 1
>  context...:
>   /Applications/Racket/collects/db/private/sqlite3/connection.rkt:457:0: 
> handle-status*
>   /Applications/Racket/collects/db/private/sqlite3/connection.rkt:413:8
>   /Applications/Racket/collects/db/private/sqlite3/connection.rkt:216:4: 
> prepare1* method in connection%
>   
> /Applications/Racket/collects/db/private/generic/../../../racket/private/more-scheme.rkt:261:28
>   [repeats 1 more time]
>   /Applications/Racket/collects/db/private/generic/functions.rkt:90:0: 
> compose-statement
>   /Applications/Racket/collects/db/private/generic/functions.rkt:148:0: 
> query-exec
>   /Users/fingal/code/bmtc_dev/app/db/tests/db_test_utils.rkt:103:8: for-loop
>   "/Users/fingal/code/bmtc_dev/app/network/reset_dbs.rkt": [running body]
>   temp37_0
>   for-loop
>   run-module-instance!125
>   perform-require!78
> 
> -- 
> 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/C399A6BF-6FDE-49AD-9053-08F0F3FBD49A%40biomantica.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/7d2f2cd4-3199-47cf-b952-93bc2494f784%40mtasv.net.


Re: [racket-users] Re: Racket v7.4

2019-08-14 Thread 'John Clements' via Racket Users
What distribution and platform do you have selected? The “variant” menu will 
only appear for certain choices of distribution and platform. 

John

> On Aug 9, 2019, at 12:04, 'Joel Dueck' via Racket Users 
>  wrote:
> 
> On Win10 / Firefox the "variant" selector does not appear for me, I'm not 
> sure why yet. I don't have any errors in the console.
> 
> I can see it just fine on Win10 / Chrome, macOS / Safari, and macOS / Firefox.
> 
> -- 
> 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/dfe730fb-b3a5-4e94-badb-875749324362%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/5d00e43a-6079-4e12-b152-ef973c3a2b65%40mtasv.net.


Re: [racket-users] [standard-fish] Reverse engineered quilt design

2019-08-01 Thread 'John Clements' via Racket Users
That’s a really nice example of the uses of abstraction in non-programming 
domains. Thanks!

John

> On Jul 30, 2019, at 19:04, Daniel Prager  wrote:
> 
> Here's a photo of the original quilt from Red Pepper Quilts (not my work):
> 
> 
> 
> More images, including details, here:  
> http://bastings54.rssing.com/browser.php?indx=6115008=60
> 
> And here's my reverse-engineered Racket version:
> 
> 
> 
> Top-level code, below.
> 
> 
> #lang racket
> 
> (require threading
>  "quilt.rkt")
> 
> ;; EXAMPLES
> ;;
> 
> ;; Build a super-duper quilt from rectangles, hsts, squares, and a
> ;; few qsts
> 
> (define qst_ (qst 1 'black 'white))
> (define qst__ (qst 1 'black 'black 'black 'white))
> (define hst_ (hst 1 'black 'white 'forward))
> 
> (define (around-the-world . ss)
>   ; error on (< (length ss) 3)
>   (define ts (map (λ (s)
> (if (symbol? s)
> (square 1 s)
> s))
>   ss))
>   
> (let around ([n(- (* 2 (length ss)) 3)])
>   (define half (/ (- n 1) 2))
>   (if (= n 3)
>   (apply surround (take ts 3))
>   (let* ([ps (take (drop ts half) (min (+ half 1)
>(- (length ts) half)))]
>  [center (first ps)]
>  [corner (last ps)]
>  [ts (rest (reverse (rest ps)))]
>  [side (apply beside 
>   (append (make-list (- half (length ts) 1)
>  corner)
>   ts))])
> (surround (around (- n 2))
>   (reflect side center)
>   corner)
> 
> (define (diamond center [surround 'white])
>   (4-square (hst 1 surround center 'forward) R))
> 
> (define hst-strip
>   (~> (reflect (beside/n 4 hst_) qst__)
>   (B (H hst_))
>   reflect))
> 
> (define b1 (around-the-world 'black
>  qst_
>  'cerise
>  'lupine
>  'caribbean
>  hst_))
> 
> (define b2 (around-the-world 'black
>  qst_
>  'amber
>  'cactus
>  'maize
>  hst_))
> 
> (define diamond-strip
>   (beside/n 11 (diamond 'black) (diamond 'caribbean)))
> 
> (define geese
>   (beside/n 9 (A (V hst_) hst_)))
> 
> (define quilt
>   (~> (grid [b1 (R geese) b2]
> [geese (diamond 'maize 'cactus) (H geese)]
> [b2 (L geese) b1])
>   (surround hst-strip hst_)
>   (surround diamond-strip (diamond 'caribbean))
>   (add-strips 'cactus)
>   (add-strips 'caribbean)
>   (add-strips 'black)))
> 
> 
> (parameterize ([units 20]
>[show-outline #t])
>   (draw quilt))
> 
> 
> -- 
> 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/CAFKxZVUFCee6LXoejHcrToKnDzOi4AUPLjCk%3DFX%3DF-MLkqLHCA%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/cf635a09-de1b-4e66-ae9e-aa3a41925756%40mtasv.net.


[racket-users] Racket v7.3.0.900 is available for testing

2019-07-23 Thread 'John Clements' via Racket Users
Version 7.3.0.900 is now available for testing from

  https://pre-release.racket-lang.org/

(Note that this is not available from the usual download site.)

If all goes well, we will turn this version into a v7.4 release
within a couple of weeks.

This release is the first one to include Chez-Scheme-based builds (labeled 
“Racket CS” on the pre-release page), and we’d be interested in hearing about 
any issues you encounter with these builds.

Your help and feedback in testing this new release candidate would be
much appreciated.



-- 
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/088c5255-2375-483a-8fe7-494528e24876%40mtasv.net.


Re: [racket-users] images for Dr Racket 7.2 (Mac)

2019-06-28 Thread 'John Clements' via Racket Users
I think the idea is that you can right-click on the image in the documentation 
using your browser and save it, then use the Insert Image menu in DrRacket to 
open the image you just saved. Does this make sense?

John

> On Jun 28, 2019, at 11:26, Bryan Pierce  wrote:
> 
> Hello everyone!!
> 
> There is probably no reason I should let this bug me so much...in fact, I 
> know I found the answer in the documentation somewhere, but now I can't find 
> it
> 
> I installed Dr Racket to work through the HTDP book, and am at the point 
> where they say we can copy and paste the "rocket" image or use the Insert > 
> Insert Image... menu
> 
> But when I try to use the menu, I can't find any images in the Racket 7.2 
> folder hierarchy
> 
> QUESTIONS
> * Are thy not installed with the Mac version of Dr Racket?
> * Is there a way to download the images from the Racket 
> website
> 
> I have tried for 2 hours now to try to find the answer by searching both the 
> internet, the group, the racket website, and the documentation
> 
> Any help or any nudges in the right direction would be greatly apprciated!!
> 
> 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/71a98a10-2dac-4957-976b-4ff81c2fac0a%40googlegroups.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/9ac78bff-ae51-45e3-a9b1-28f790eaf154%40mtasv.net.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Jupyter Racket Kernel - iracket

2019-06-26 Thread 'John Clements' via Racket Users
It may be that ‘raco’ is not in your path. An alternative is to use the 
“Package Manager” that’s built into DrRacket, under “File>Package Manager…” to 
install libraries such as iracket.

> On Jun 23, 2019, at 09:10, Arie Schlesinger  
> wrote:
> 
> Hi,
> I am trying to install racket for jupyter on a mac, and from the github it is 
> not clear for me how to do it.  
> I use Dr Racket,  still running "raco pkg install iracket" is not recognized 
> in the mac shell.
> 
> Thanks,
> Ari
> 
> On Friday, May 4, 2018 at 9:57:42 AM UTC+3, Graham Dean wrote:
> Pleasure Ryan. Thanks for developing iracket, it's really useful for me to 
> demonstrate on-going work using Racket.
> Graham
> 
> 
> -- 
> 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/e58716f9-f60f-48a7-a2bf-d79d477880a0%40googlegroups.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/cf2c5b2c-3211-45a6-a2d1-a9d3020e08e4%40mtasv.net.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Some concern about ChezScheme...

2019-05-27 Thread 'John Clements' via Racket Users
I’m responding to my own message, because (thanks to Andy Keep) I’ve now 
discovered a big chunk of the answer.

Specifically, it looks Jeremy Siek’s compilers class includes a textbook 
written by him and Ryan Newton whose preface appears to answer all of my 
questions; specifically, that they did merge Ghuloum’s approach with nanopasses.

https://iu.instructure.com/courses/1735985

https://github.com/IUCompilerCourse/Essentials-of-Compilation

> On Feb 9, 2019, at 10:33, John Clements  wrote:
> 
> 
> 
>> On Feb 8, 2019, at 15:01, George Neuner  wrote:
>> 
>> On Fri, 8 Feb 2019 08:37:33 -0500, Matthias Felleisen
>>  wrote:
>> 
>>> 
 On Feb 6, 2019, at 3:19 PM, George Neuner  wrote:
>> 
 
 The idea that a compiler should be structured as multiple passes each
 doing just one clearly defined thing is quite old.  I don't have
 references, but I recall some of these ideas being floated in the late
 80's, early 90's [when I was in school].
 
 Interestingly, LLVM began (circa ~2000) with similar notions that the
 compiler should be highly modular and composed of many (relatively
 simple) passes.  Unfortunately, they quickly discovered that, for a C
 compiler at least, having too many passes makes the compiler very slow
 - even on fast machines.  Relatively quickly they started combining
 the simple passes to reduce the running time. 
>>> 
>>> 
>>> I strongly recommend that you read the article(s) to find out how
>>> different nanopasses are from the multiple-pass compilers, which
>>> probably date back to the late 60s at least. — Matthias
>> 
>> I did read the article and it seems to me that the "new idea" is the
>> declarative tool generator framework rather than the so-called
>> "nanopass" approach.  
>> 
>> The distinguishing characteristics of "nanopass" are said to be:
>> 
>> (1) the intermediate-language grammars are formally specified and
>>enforced;
>> (2) each pass needs to contain traversal code only for forms that
>>undergo meaningful transformation; and
>> (3) the intermediate code is represented more efficiently as records
>> 
>> 
>> IRs implemented using records/structs go back to the 1960s (if not
>> earlier).
>> 
>> 
>> Formally specified IR grammars go back at least to Algol (1958). I
>> concede that I am not aware of any (non-academic) compiler that
>> actually has used this approach: AFAIAA, even the Algol compilers
>> internally were ad hoc.  But the *idea* is not new.
>> 
>> I can recall as a student in the late 80's reading papers about
>> language translation and compiler implementation using Prolog
>> [relevant to this in the sense  of being declarative programming]. I
>> don't have cites available, but I was spending a lot of my library
>> time reading CACM and IEEE ToPL so it probably was in one of those.
>> 
>> 
>> I'm not sure what #2 actually refers to.  I may be (probably am)
>> missing something, but it would seem obvious to me that one does not
>> write a whole lot of unnecessary code.
> 
> 
> Hmm… I think I disagree.  In particular, I think you’re missing the notion of 
> a DSL that allows these intermediate languages to be specified much more 
> concisely by allowing users to write, in essence, “this language is just like 
> that one, except that this node is added and this other one is removed.” I 
> think it’s this feature, and its associated 
> automatic-translation-of-untouched-nodes code, that makes it possible to 
> consider writing a 50-pass parser that would otherwise have about 50 x 10 = 
> 500 “create a node by applying the transformation to the sub-elements” 
> visitor clauses. Right?
> 
> In fact, as someone who’s about to teach a compilers class starting in April 
> and who’s almost fatally prone to last-minute pivots, I have to ask: is 
> anyone that you know (o great racket users list) currently using this 
> approach or these tools? Last year I went with what I think of as the Aziz 
> Ghuloum via Ben Lerner approach, starting with a trivial language and 
> widening it gradually. I see now that Ghuloum was actually teaching at IU 
> when he wrote his 2006 Scheme Workshop paper, and that although he cites 
> about fifteen Dybvig papers, the nanopass papers don’t seem to be among them.
> 
> Hmm…
> 
> 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/cd4334d7-0054-4ec6-9072-1c678e9cb0c4%40mtasv.net.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Racket v7.3

2019-05-15 Thread 'John Clements' via Racket Users
--
Racket version 7.3 is now available from

   https://racket-lang.org/

Racket-on-Chez continues to improve. Snapshot builds are currently
available at pre.racket-lang.org, and we expect that Racket-on-Chez
will be included as a download option in the next release.

In addition, the Racket 7.3 release includes the following improvements:

- There is a new set of teaching languages for the upcoming
  German-language textbook "Schreibe Dein Programm!"
  (https://www.deinprogramm.de/).

- Racket's IO system has been refactored to improve performance
 and simplify internal design.

- Racket's JSON reader is dramatically faster.

- The `plot` library includes color map support for renderers.

- The Racket web library has improved support for 307 redirects.

- The Racket web server provides better response messages by default
 for common status codes.

- The `pict` library includes a `shear` function.

The following people contributed to this release: Alex Harsányi,
Alexander McLin, Alexander Shopov, Alexis King, Alex Knauth, Andrew
Kent, Bert De Ketelaere, Ben Greenman, Fred Fu, Georges Dupéron, Greg
Hendershott, Gustavo Massaccesi, Jay McCarthy, Jesse Alama John
Clements, Jordan Johnson, Kimball Germane, Lassi Kortela, Leif Andersen
Leo Uino, Marc Kaufmann, Matthew Butterick, Matthew Flatt, Matthias
Felleisen Michael MacLeod, Mike Sperber, Paulo Matos, Philip McGrath
Philippe Meunier, Pierre-Evariste Dagand, qww6, Robby Findler, Ron
Garcia, Ryan Culpepper, Ryan Kramer Sam Tobin-Hochstadt, Shu-Hung You,
Sorawee Porncharoenwase, Spencer Florence Spencer Mitchell, Stephen De
Gabrielle, Vincent St-Amour, Vladilen Kozin, Winston Weinert, yjqww6,
and Wayo Cavazos

Feedback Welcome

--



-- 
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/bacfd94f-2486-4d3f-ab32-f2e222d82f75%40mtasv.net.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Haskell

2019-05-14 Thread 'John Clements' via Racket Users
Hmm… While I certainly agree that functional languages are good at manipulating 
program representations, this job (manipulating programs) is more or less *the 
one thing* that Racket does better than any other language. So… I guess I’d be 
more likely to use Racket to manipulate Haskell programs than vice versa. Of 
course, your mileage may vary… :)

John Clements


> On May 14, 2019, at 8:23 AM, Josh Rubin  wrote:
> 
> It just occurred to me that Haskell could be a powerful way to manipulate 
> programs in other languages (like Scheme or Racket). Unfortunately, I don't 
> know Haskell. Has anybody been down this path?
> -- 
> Josh Rubin
> 
> jlru...@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/d2961559-f8af-c6d0-15e1-9c20b3dab959%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/a2d3bd9a-5057-4c36-aa52-0862ad103a0b%40mtasv.net.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Keeping my mind sharp

2019-05-11 Thread 'John Clements' via Racket Users



> On May 11, 2019, at 07:15, Josh Rubin  wrote:
> 
> Some people in their 60's do crossword puzzles to keep their mind sharp. I 
> want to return to compiler hacking. I have experience with the ideas and code 
> from many old compilers - MIT MacLisp and Rabbit (the grandfather of all 
> Schemes), David Betz's Xscheme (shout out!), Texas Instruments Scheme. My 
> 1980's home-brew byte-code compiler passed compliance tests and ran large 
> existing Scheme programs. PLT Scheme existed but I never used it.

Welcome!
> 
> I want to run some of my old code and learn Racket at the same time. There 
> will be problems: my declining technical chops, defmacro, and name 
> collisions. I haven't programmed in many years. I haven't even written Hello 
> World for Racket yet. I must be a fool.

Doubtful!

> 
> Is it feasible to use Racket to create an environment for my old scheme code?

Yes!
> 
> What forums/mailing-lists should I join? Will Google Groups continue to exist?

This one!
> 
> I welcome any tips you might have.

Ah, now there you’ve got me. Oh here’s one: come to RacketCon?


John Clements

-- 
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/008568f7-6cda-45ef-a3a2-dfb074ac6457%40mtasv.net.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Idle UI thought: compiling/running indicator?

2019-05-09 Thread 'John Clements' via Racket Users
In dealing with students, it’s a constant frustration to me that students don’t 
realize that clicking the ‘run’ button triggers both compilation and running. 
Also, in my own work, I sometimes forget to compile things at the command line, 
and then wonder why my programs are taking forever to run. 

How hard would it be to make a two-state “running” icon; one color/shape when 
we haven’t yet started phase 0 for the code in the buffer, and a different one 
afterward? Does this seem like it might be useful?

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/4b6abd4e-ec57-4cb9-a696-b57850de7b54%40mtasv.net.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Stack trace

2019-05-02 Thread 'John Clements' via Racket Users
Well, I see two things going on here.

First, this example is an interesting one, because there’s no stack trace to 
display; the (/ 1 n) is the only “frame” left on the “stack”, because the call 
to sub2 has already returned, and the body of “reciprocal” is in tail position 
with respect to the call. If you add a “(+ 1 …)” around the reciprocal call, 
then there’s a stack to display…

…except that you still won’t see an arrow in BSL, because that’s a #lang racket 
thing. That is: if you change the language to “Use language defined in source”, 
and insert #lang racket at the beginning, and add a (+ 1 …) around the 
reciprocal, and run the program, you’ll see an arrow from the (/ 1 n) to the (+ 
1 …) context as I believe you expected.

I think the pedagogically correct answer here is that the arrows that you see 
in racket aren’t really the “right thing” for an educational setting. Instead, 
I think I might suggest using the stepper, instead. (Me? Biased?) In this case, 
I think I would jump to the end of the evaluation, and then step backward to 
see where the error came from.

I also think that there’s probably value in the “tree-cer” approach that 
Krishnamurthi et al. have been working on[*] for Pyret, which shows the 
evaluation of a term as a single large tree, allowing you to inspect each call 
and the arguments that were passed to each call.

John

[*] I thought of it independently, but they thought of it first, and actually 
implemented it. :)


> On May 2, 2019, at 4:02 PM, Mark Engelberg  wrote:
> 
> Working with a student in DrRacket for the first time in a while.
> 
> I notice that in BSL, an error in a function does not tell you what input to 
> the function caused the error, nor does it show the stack trace by drawing 
> arrows in the definitions window the way I remember.
> 
> When did this behavior change? Is there a way to turn on better error 
> reporting and stack traces?
> 
> Example:
> 
> (define (reciprocal n)
>   (/ 1 n))
> 
> (define (sub2 n)
>   (- n 2))
> 
> (define a (reciprocal (sub2 2)))
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] make extensions or replacements

2019-04-19 Thread 'John Clements' via Racket Users
There’s a paper at the most recent ICFP from Simon Peyton Jones (et al., I’m 
guessing) on make languages, IIRC.

John

> On Apr 16, 2019, at 2:09 PM, Greg Hendershott  
> wrote:
> 
> I have a shallow understanding of GNU Make, which is only somewhat
> less-shallow as a result of recently redesigning my blog to be
> Makefile-driven.
> 
> In the process I learned to like using make variables. I learned that
> a variable can be populated from make functions like $(wildcard)
> $(patsubst) and the ultimate escape hatch $(shell).
> 
> So, if you have (say) 5 unique stanzas, it might be possible to
> arrange this as 5 variables -- each of which is a list of that kind of
> source or target files. Then you can state the build recipe once in a
> single rule for each.
> 
> If the 5 kinds of things have distinct file extensions, or are in
> distinct subdirs, this is fairly easy to do with $(wildcard) and/or
> $(patsubt).  Otherwise (if you can't or prefer not to give them
> distinct extensions or locations), then potentially you can use
> $(shell) to run something that knows how to distinguish them. Maybe a
> find or grep command. Maybe even a little .rkt program.
> 
> So my guess is that the means of abstraction you need, does exist in
> GNU Make. But even so, it sounds like you might not enjoy using it.
> 
> On Tue, Apr 16, 2019 at 4:13 PM Hendrik Boom  wrote:
>> 
>> On Tue, Apr 16, 2019 at 09:54:03PM +0200, da...@erl.nu wrote:
>>> Hendrik,
>>> 
>>> What is that you are trying to do, maybe you are misunderstanding some
>>> concept about make?
>>> 
>>> It seems to me that the whole point of make is to "run a program" whenever
>>> some of the files have changed.
>> 
>> Yes, that part of make is easy.
>> 
>> The problem comes when you have many files that have to be made
>> depending on many files and there is a repetitive nature to the
>> dependencies.  The kind of similarity that is handled by abstraction in
>> any normal programming language.
>> 
>> And make itself has rules that can be used to do things like make *.out
>> files from *.in files based on the file types, a long as the rules can
>> be expanded by filling in the rest of the file names.  These are used
>> when it provides, say, default rules to compile .c files to .o files
>> and the like.
>> 
>> This is, I guess, a kind of abstraction.  But abstraction that takes
>> only one parameter is a poor kind of abstraction.
>> 
>> There seems to be no mechanism to provide additional parameters to
>> these rules, to accomodate slight variations in the stanzas.
>> 
>> I've thought of using Racket to generate stanzas.  Or to avoid
>> generating Makefiles altogether and directly implement make-like
>> semantics in Racket using its profound flexibility and then to use
>> Racket code to Make whatever I want.
>> 
>> But maybe, just maybe, there are already better tools than GNU make.
>> 
>> -- hendrik
>> 
>> 
>>> 
>>> Regards,
>>> 
>>> David
>>> 
>>> On 2019-04-16 21:25, Hendrik Boom wrote:
 I'm sending this here, not because it's directly related to Racket,
 nor because i think you all are experts in make or GNU make, but
 because you are reasonable erudite in language appreciation.
 
 I, like many others, have been using a Makefile as a recipe to make a
 lot of files from other files.
 
 The trouble is that a lot of the stanzas are quite repetitive.  I want
 to refactor.
 
 If I were writing this in any other language then make,  i would just
 define a function with about three or four short parameters and call it
 many times, each time doing the equivalent of several of these stanzas.
 
 Roughly speaking, the abstraction tools of GNU Make are terrible.
 
 I'd like to ask you, what other tools might you actually recommend to
 used in addition to make, or instead of it, that make the build
 process more like normal programming?
 
 If I could get make to run a program to make another makefile and then
 execute that new makefile, I suppose I could write the program that
 makes all the repetitive (but not quite the same) stanzas.  But that
 would likely make the build process somewhat obscure.
 
 Sure, I could invent something.  But chances are, someone else already
 has invented something better than I'd improvise.
 
 -- 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.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 

Re: [racket-users] lists.racket-lang.org seems to be down

2019-04-17 Thread 'John Clements' via Racket Users
I haven’t checked, but my recollection is that this is/was a pointer to the 
dearly departed winooski. I believe that we will get this running again, we 
appear to have the replacement machine at least partly provisioned, but I 
wouldn’t expect it to be up in the next day or two. 

John

> On Apr 17, 2019, at 6:47 AM, Sean Kemplay  wrote:
> 
> H All,
> 
> Just reporting that https://lists.racket-lang.org/ seems to be down.
> 
> I have tried on both my laptop and phone.
> 
> Sean
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Help with pretty printing

2019-04-04 Thread 'John Clements' via Racket Users
I’m glad to hear it! I think that it may not fail in nice ways for deeply 
nested s-expressions, but that not be an issue for you. I do think that there 
should be a nicer way than using a text%. 

John

> On Apr 4, 2019, at 11:14 AM, Stephen Foster  wrote:
> 
> Thanks, John.  Actually, when you distinguished between the line breaks and 
> the indentation, that helped me come up with the following algorithm.  It 
> basically, 1) lets pretty-print do its thing (inserting more line breaks than 
> I need), 2) uses a regex to scrub out all line breaks after a keywords, and 
> 3) fixes up the indentation after the fact.
> 
> (define (idiomatic-pretty-format d)
>   (define too-many-line-breaks (pretty-format d 0))
>   
>   (define (fix-line-breaks s)
> (regexp-replace* #px"(#:\\S*)\\s*" s "\\1 “))
>   
>   (define (fix-indentation s)
> (local-require framework)
> 
> (define t (new racket:text%))
> (send t insert s)
> (send t tabify-all)
> (send t get-text))
>   
>   (fix-indentation (fix-line-breaks too-many-line-breaks)) )
> 
> 
> I wasn't able to see anything in the pretty-print hooks documentation that 
> seemed to promise a more elegant solution.  However, perhaps I can build my 
> own printer with this pretty printing library: 
> https://docs.racket-lang.org/pprint/index.html
> 
> NOTE: The above function does have the drawback that it relies on 
> racket:text% -- which seems both a little excessive and also will trigger the 
> "Cannot require racket/gui/base a second time" error if you try to call it 
> from a Scribble doc.
> 
> Still on the hunt for a better way...
> 
> On Tue, Apr 2, 2019 at 4:47 PM John Clements  
> wrote:
> One note about this: it’s not really a question about indentation, which 
> isn’t ludicrously hard, it’s a question about inserting linebreaks, which 
> IMHO is much harder. Specifically, you’re asking for a pretty-printer that 
> treats keywords differently from other items. Have you looked through all of 
> the pretty-print hooks at
> 
> https://docs.racket-lang.org/reference/pretty-print.html?q=pretty-print#%28def._%28%28lib._racket%2Fpretty..rkt%29._pretty-print%29%29
> 
> ?
> 
> I’m pretty sure that what you want is not in there, but you should take a 
> look anyway.
> 
> John
> 
> 
> > On Apr 2, 2019, at 3:47 PM, Stephen Foster  wrote:
> > 
> > Hi all,
> > 
> > Suppose, I have a datum that represents valid racket code, like '(test #:a 
> > a #:b b #: c).  I'd love to render (arbitrarily deeply nested) datums like 
> > this to a string that displays like this:
> > 
> > (test
> >   #:a a
> >   #:b b
> >   #:c c)
> > 
> > Pretty printing almost works:
> > 
> > (displayln
> >(pretty-format
> > '(test #:a a #:b b #:c c)
> >24))
> > 
> > '(test
> >   #:a
> >   a
> >   #:b
> >   b
> >   #:c
> >   c)
> > 
> > I thought that fiddling with the columns parameter would help, but it 
> > doesn't:
> > 
> > (displayln
> >(pretty-format
> > '(test #:a a #:b b #:c c)
> >25))
> > 
> > (test #:a a #:b b #:c c)
> > 
> > Maybe there's some way can get racket/pretty to do what I want -- though I 
> > didn't see anything jump out at me in docs.
> > 
> > I was about to write my own pretty printer, but I figured that with so much 
> > stuff out there for typesetting Racket code (e.g in Scribble), I should at 
> > least ask if someone knows of something that does what I want: Basically, 
> > magically formats datums according to Rackety indentation idioms.  
> > 
> > Thanks,
> > 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.
> > For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> 
> 
> -- 
> 
> 
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread 'John Clements' via Racket Users
Oog… I don’t really think dynamic-require is the right tool here at all. 
Setting the current-output-port seems vastly more reasonable.

John

> On Apr 1, 2019, at 12:19, Chansey  wrote:
> 
> More elegant way is combining with-output-to-file with dynamic-require
> 
> (with-output-to-file FILE
>   (lambda () (dynamic-require "main.rkt" #f))
>   )
> 
> On Tuesday, April 2, 2019 at 1:53:47 AM UTC+8, Chansey wrote:
> Dear George,
> 
> Your method is also very well.
> 
> Because using with-output-to-file to wrapper main.rkt is enough, not must in 
> every module files.
> 
> Thanks.
> 
> On Tuesday, April 2, 2019 at 1:30:09 AM UTC+8, gneuner2 wrote:
> 
> On 4/1/2019 1:09 PM, Siyuan Chen wrote: 
> > Dear George, 
> > 
> > This means we must modify these module code? 
> > 
> > For example: 
> > 
> > suppose in foo.rkt 
> > 
> > #lang racket 
> > (provide ...) 
> > (require ...) 
> > 
> > (define (my-func-1 x) 
> > ...printf..) 
> > 
> > (define (my-func-2 x) 
> >   ...printf..) 
> > 
> > It must be modified to this? 
> > 
> > #lang racket 
> > (provide ...) 
> > (require ...) 
> > 
> > (with-output-to-file  
> >(lambda () 
> >   (define (my-func-1 x) 
> > ...printf..) 
> > 
> > (define (my-func-2 x) 
> >   ...printf..) 
> >)) 
> > 
> > It seems not very convenient... 
> > 
> > Is it possible to temporarily change global output port? 
> > 
> > Thanks. 
> 
> 
> Not exactly.  You don't need to encapsulate the function definitions - 
> just the calls.  IT would be more like the following: 
> 
> #lang racket 
> (provide ...) 
> (require ...) 
> 
>(define (my-func-1 x) 
> ...printf..) 
> 
> (define (my-func-2 x) 
>...printf..) 
> 
> 
> (with-output-to-file  
> (lambda () 
>(my-func-1 ...) 
>(my-func-2 ...) 
> ... 
> )) 
> 
> 
> But if that still is too heavyweight, the best solution is to run the 
> program from the command line and redirect or tee the output into a 
> file:  e.g., 
> 
> racket [flags] program > file 
> or 
> racket [flags] program | tee file 
> 
> The exact flags to use depend on the specifics of your program (e.g., is 
> it a script, is it a module, etc.): 
> https://docs.racket-lang.org/reference/running-sa.html?q=command%20line#%28part._mz-cmdline%29
>  
> 
> Note: Windows doesn't have "tee", but you can do something similar with 
> racket [flags] program > file 2>&1 
> 
> George 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Pretty display of tabular data?

2019-03-16 Thread 'John Clements' via Racket Users
Yep, excellent idea. I’ve added the ’tabular’ tag to csv-writing.

John

> On Mar 15, 2019, at 3:24 AM, jackhfi...@gmail.com wrote:
> 
> I think we should all work towards making our existing code in this area more 
> discoverable, so we can get a better sense of what libraries for working with 
> tables exist in the wild. To those of you who own Racket packages that 
> provide any functionality related to data tables: I recommend adding the 
> "tabular" tag to your package's description in the package catalog. There's 
> no need to remove more-specific tags (like "data-frame") from your package, 
> but even if you have a more specific tag please include the general "tabular" 
> tag so it's easy to search for your package. So far there's only 3 packages 
> tagged with "tabular" (and one of those is a package of mine that I just 
> tagged while writing this post). I see several packages that are good 
> candidates for the tag:
>   • data-frame
>   • sqlite-table
>   • table-panel
>   • tabular
>   • rml-core (maybe?)
>   • sinbad
>   • spmatrix (maybe?)
>   • spreadsheet-editor
>   • csv
>   • csv-reading
>   • csv-writing
>   • simple-csv
>   • Most things with the "sql" tag
> The more packages we have tagged and documented, the easier it will be to 
> find real code using tables in the wild. Which is information we'll need if 
> we want to understand how a standard `racket/table` API might look.
> 
> On Thursday, March 14, 2019 at 10:28:41 AM UTC-7, Ryan Kramer wrote:
> On Thursday, March 14, 2019 at 12:26:39 AM UTC-5, Alex Harsanyi wrote:
> 
> There are now several projects announced on this list, all of them deal with
> data analysis on one way or the other.  Would it be possible to join forces
> and merge these projects so that we end up with one library that servers
> multiple purposes equally well?  Something where the final product is greater
> than the sum of its parts...
> 
> Or perhaps these libraries have aims that are so different from each other
> that the only thing they share is a very abstract concept of "table"?
> 
> I think my project "plisqin" is one of those you are thinking of. Matt's 
> "tbl" is also one. I'm also keeping an eye on Ryan's "sql". Are there any 
> more you were thinking of?
> 
> Regarding joining forces/merging these projects, this is a good question that 
> I think warrants discussion. So I'll share my thoughts.
> 
> Obviously I can't speak for all of us, but right not I only see the "very 
> abstract concept of "table"" as potential shared code. (Also, learning about 
> snip% earlier in this thread was awesome. I'd love to use something like that 
> in my project.)
> 
> I think the differences between plisqin and tbl are fairly obvious - plisqin 
> is an alternative to SQL while tbl is an alternative to "Python/NumPy/SciPy, 
> or R/Tidyverse (or, horrors, plain R)"
> 
> Now comparing Ryan's sql to plisqin is a different story. These projects are 
> both alternatives to SQL. But I think there is enough difference between our 
> approaches and scope to warrant separate projects, at least for now.
> 1) sql seems to be mostly implemented as macros. plisqin is mostly 
> implemented as procedures.
> 2) plisqin has some design decisions that some might consider "too much 
> magic", namely inline joins and "inject-able aggregates" (need better name) 
> as documented here: https://docs.racket-lang.org/plisqin/intro.html. Whereas 
> sql-the-package seems to more closely mirror SQL-the-language - it would be 
> difficult to surprise yourself with the SQL you generate.
> 3) I am trying to design #lang plisqin so that people with no Lisp experience 
> can use it. (Whether I will succeed is another matter...)
> 
> I apologize to Ryan C if I have mischaracterized sql. I'd like to have a 
> longer conversation about this, but maybe this list is not the right place. 
> (Also, Ryan, if you think our goals are more similar than I do, I'd be happy 
> to work with you. You're definitely a more experienced Racketeer and it would 
> surely boost my code quality.)
> 
> - Ryan Kramer
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: What is the best way to "raco make" all *.rkt files in a directory tree?

2019-03-11 Thread 'John Clements' via Racket Users
I would suggest maybe just using racket here:

#lang racket

(require setup/parallel-build)

(define racket-files
  (for/list ([file (in-directory "/tmp")]
 #:when (regexp-match #px"\\.rkt$" file))
file))

(parallel-compile-files racket-files
#:worker-count 8)


Naturally, you could also use (current-directory) rather than “/tmp”, or 
whatever makes sense for you. You could even bundle it up as a raco command, if 
you liked.

John


> On Mar 11, 2019, at 1:02 PM, Eric Griffis  wrote:
> 
> On Mon, Mar 11, 2019 at 12:04 PM Brian Adkins  wrote:
>> 
>> Hmm...  maybe the problem was just my lack of shell skills. I think the 
>> following works:
>> 
>> raco make -j 8 */*.rkt
> 
> This will only make the rkt files in subdirectories of the current
> working directory, excluding sub-subdirectories and the current
> working directory.
> 
> You can get them all with "find":
> 
> find . -name \*.rkt -exec raco make -j 8 {} \;
> 
> But this will run a separate "raco make" for each file, which may
> defeat the purpose of your "-j 8" switch. If your shell supports the
> "globstar" (**) in file paths (e.g. bash, zsh, maybe ksh):
> 
> raco make -j 8 *.rkt **/*.rkt
> 
> Otherwise, there's always xargs:
> 
> find . -name \*.rkt -print0 | xargs -0 -- raco make -j 8
> 
> FWIW, when my projects need "make"-ing, I turn them into packages and
> install them. The installation process will "make" every rkt file in
> the project folder, and the whole thing can be rebuilt with raco
> setup:
> 
> raco setup -D 
> 
> Eric
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] TR: tighten type of "random" ? (and so much more...)

2019-02-27 Thread 'John Clements' via Racket Users
I was doing some very low-key monte carlo testing today, and I wanted to 
whether it would magically get faster if I used TR. The short answer is … well, 
wait on that. Here’s my program; it’s supposed to check the likelihood that 
three randomly chosen numbers in the interval 0-1 could be the sides of an 
acute triangle:

#lang typed/racket


(define-predicate nneg-flonum? Nonnegative-Flonum)
;; comment it out for no-check...
; (define (nneg-flonum? n) #t)

(define (run-trials [trials : Natural])
  (exact->inexact
   (/ (for/sum : Natural
([i (in-range trials)])
(define a (assert (random) nneg-flonum?))
(define b (assert (random) nneg-flonum?))
(define c (assert (random) nneg-flonum?))
(if (and (< (abs (- a b)) c)
 (< c (sqrt (+ (* a a) (* b b)
1
0))
  trials)))


(time
 (for ([i : Natural (in-range 26)])
   (define trials (expt 2 i))
   (printf "~v trials: ~v\n"
   trials (run-trials trials

;; IN DRRACKET, "no debugging or profiling"

;; TR:cpu time: 37953 real time: 36371 gc time: 3849
;; TR/NC: cpu time: 33632 real time: 33959 gc time: 8511

;; COMMAND-LINE

;; TR:cpu time: 24707 real time: 24693 gc time: 27
;; TR:cpu time: 26602 real time: 26610 gc time: 27
;; TR/NC: cpu time: 12735 real time: 12727 gc time: 132
;; TR/NC: cpu time: 12715 real time: 12713 gc time: 116


One thing that I was curious about was the necessity for the assertion on the 
result of random. Specifically, it appears to me that the result of the call 
(random) is guaranteed to be a Nonnegative-Flonum, but the type on Random is 
not that specific:

(case->
 (->* (Integer Integer) (Pseudo-Random-Generator) Nonnegative-Fixnum)
 (->* (Integer) (Pseudo-Random-Generator) Nonnegative-Fixnum)
 (->* () (Pseudo-Random-Generator) Flonum))


Is there a reason for this?


More generally, of course, I’d like to know why the TR version isn’t faster; I 
ran the given timings on the command-line, which seemed to speed up the 
no-check version immensely and the TR version hardly at all. I checked the 
optimization coach, and all of the numeric portions are solid green. Maybe the 
numeric portion of the inner loop isn’t the slow part?

I tried some amateur loop-unrolling, duplicating the inner body 4 times and 
running the loop 1/4 as many times, and … got essentially no difference, which 
would suggest that the arithmetic part *is* the slow part.

…

or

… Ah! It’s the calls to “random”. reducing the calls to random by a factor of 
four makes the code run about four times faster. Hmm… How about those 
assertions?

Oh! look! changing (assert (random) nneg-flonum?) into (assert (random) 
positive?) makes the code twice as fast! So apparently using an assert with a 
define-predicate is not a good idea, at least in this case. Is that generally 
true?

Okay, I just went to “show more” on the Optimization Coach, and two fascinating 
things happened
1) The colors went bananas, and editing the file put me in sliding-highlight 
hell, so I had to close and re-open the buffer.
2) The optimization coach suggested that the parameter lookup of 
(current-pseudo-random-generator) could be slow, so I should look it up once. I 
took this advice and…
racket is now segfaulting reliably. Whoops! Time to file a PR.

Well, okay, that’s (tallying…) one change request (type of random), one 
question (bad idea to use define-predicate?), one vague bug report 
(optimization coach coloring), and one straight-up crash (seg fault). I think 
I’ve used my quota, back to real work.

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


[racket-users] tree-layout, many many thanks

2019-02-26 Thread 'John Clements' via Racket Users
I wanted to format binary search trees for a data structures exam. I spent 
literally hours trawling through old source code to see how I’d done it before… 
graphviz? tikzpicture? … before giving up and doing what I should have done in 
the first place, looking in the racket docs. Tree-layout does exactly what I 
want, renders to .pdf, and I’m done. 

My major mistake: looking elsewhere!

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


Re: [racket-users] Cannot use case+else inside match+else

2019-02-25 Thread 'John Clements' via Racket Users
I may be missing something obvious, here, but why are you using the name “else” 
to bind the result in the match clause? I usually use the name “other”, which 
might solve your problem.

John

> On Feb 25, 2019, at 4:32 PM, Shu-Hung You 
>  wrote:
> 
> When using a case expression with an else clause in inside a match
> expression, the expander complains about case having a bad syntax.
> However, the use of case expressions outside of match are fine. Is
> there anyway to get around this?
> 
> Currently, I just replace it with another match.
> 
> #lang racket/base
> 
> (require racket/match)
> 
> (match 6
>  [else
>   (case 5
> [else 7])])
> 
> #|
> unsaved editor:8:6: case: bad syntax (not a datum sequence) at: else
> in: (case 5 (else 7))
>  #(78 4)
> |#
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] type annotation example

2019-02-25 Thread 'John Clements' via Racket Users
When I paste that code into a file called `foo`, it runs fine. Transcript:

hardy:/tmp clements> cat foo
#lang typed/racket
(require typed/racket/base)

(: fn (-> String Symbol))
(define (fn str) 'foo)
hardy:/tmp clements> racket foo
hardy:/tmp clements> 

I can’t honestly guess what the problem is. Wrong version of racket? 

John


> On Feb 25, 2019, at 10:11 AM, Brian Craft  wrote:
> 
> Doing a cut & paste from the typed racket docs, I'm getting a compile error. 
> Input file:
> 
> #lang typed/racket
> (require typed/racket/base)
> 
> (: fn (-> String Symbol))
> (define (fn str) 'foo)
> 
> 
> 'fn' taken from this page:
> 
> https://docs.racket-lang.org/ts-guide/more.html#%28part._when-annotations~3f%29
> 
> 
> Running with 'racket foo', gives me
> Type Checker: ->: bad syntax
>   in: (-> String Symbol)
> 
> 
> What am I doing wrong?
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] big-step-stepper ==> tree-er?

2019-02-22 Thread 'John Clements' via Racket Users
Has anyone explored the idea of a “big-step stepper”? It wouldn’t be a 
“stepper” at all, of course, just a big tree, but you could imagine a learning 
tool that allows you to explore the evaluation of a term by unfolding parts of 
its big-step tree.  Generating the raw data for this tree would be a 
substantial simplification of the existing stepper. Has this been done already?

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


Re: [racket-users] performance, json

2019-02-22 Thread 'John Clements' via Racket Users
I’m not that surprised :).

My guess is that our json reader could be sped up quite a bit. This looks like 
the heart of the read-json implementation:

(define (read-json* who i jsnull)
  ;; Follows the specification (eg, at json.org) -- no extensions.
  ;;
  (define (err fmt . args)
(define-values [l c p] (port-next-location i))
(raise-read-error (format "~a: ~a" who (apply format fmt args))
  (object-name i) l c p #f))
  (define (skip-whitespace) (regexp-match? #px#"^\\s*" i))
  ;;
  ;; Reading a string *could* have been nearly trivial using the racket
  ;; reader, except that it won't handle a "\/"...
  (define (read-string)
(define result (open-output-bytes))
(let loop ()
  (define esc
(let loop ()
  (define c (read-byte i))
  (cond
[(eof-object? c) (err "unterminated string")]
[(= c 34) #f]   ;; 34 = "
[(= c 92) (read-bytes 1 i)] ;; 92 = \
[else (write-byte c result) (loop)])))
  (cond
[(not esc) (bytes->string/utf-8 (get-output-bytes result))]
[(case esc
   [(#"b") #"\b"]
   [(#"n") #"\n"]
   [(#"r") #"\r"]
   [(#"f") #"\f"]
   [(#"t") #"\t"]
   [(#"\\") #"\\"]
   [(#"\"") #"\""]
   [(#"/") #"/"]
   [else #f])
 => (λ (m) (write-bytes m result) (loop))]
[(equal? esc #"u")
 (let* ([e (or (regexp-try-match #px#"^[a-fA-F0-9]{4}" i)
   (err "bad string \\u escape"))]
[e (string->number (bytes->string/utf-8 (car e)) 16)])
   (define e*
 (if (<= #xD800 e #xDFFF)
 ;; it's the first part of a UTF-16 surrogate pair
 (let* ([e2 (or (regexp-try-match #px#"^u([a-fA-F0-9]{4})" 
i)
(err "bad string \\u escape, ~a"
 "missing second half of a UTF16 pair"))]
[e2 (string->number (bytes->string/utf-8 (cadr e2)) 
16)])
   (if (<= #xDC00 e2 #xDFFF)
   (+ (arithmetic-shift (- e #xD800) 10) (- e2 #xDC00) 
#x1)
   (err "bad string \\u escape, ~a"
"bad second half of a UTF16 pair")))
 e)) ; single \u escape
   (write-string (string (integer->char e*)) result)
   (loop))]
[else (err "bad string escape: \"~a\"" esc)])))
  ;;
  (define (read-list what end-rx read-one)
(skip-whitespace)
(if (regexp-try-match end-rx i)
'()
(let loop ([l (list (read-one))])
  (skip-whitespace)
  (cond [(regexp-try-match end-rx i) (reverse l)]
[(regexp-try-match #rx#"^," i) (loop (cons (read-one) l))]
[else (err "error while parsing a json ~a" what)]
  ;;
  (define (read-hash)
(define (read-pair)
  (define k (read-json))
  (unless (string? k) (err "non-string value used for json object key"))
  (skip-whitespace)
  (unless (regexp-try-match #rx#"^:" i)
(err "error while parsing a json object pair"))
  (list (string->symbol k) (read-json)))
(apply hasheq (apply append (read-list 'object #rx#"^}" read-pair
  ;;
  (define (read-json [top? #f])
(skip-whitespace)
(cond
  [(and top? (eof-object? (peek-char i))) eof]
  [(regexp-try-match #px#"^true\\b"  i) #t]
  [(regexp-try-match #px#"^false\\b" i) #f]
  [(regexp-try-match #px#"^null\\b"  i) jsnull]
  [(regexp-try-match
#rx#"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?" i)
   => (λ (bs) (string->number (bytes->string/utf-8 (car bs]
  [(regexp-try-match #rx#"^[\"[{]" i)
   => (λ (m)
(let ([m (car m)])
  (cond [(equal? m #"\"") (read-string)]
[(equal? m #"[")  (read-list 'array #rx#"^\\]" read-json)]
[(equal? m #"{")  (read-hash)])))]
  [else (err (format "bad input~n ~e" (peek-bytes (sub1 
(error-print-width)) 0 i)))]))
  ;;
  (read-json #t))


… and my guess is that the JS performance would be similar, if the json reader 
in JS was written in JS. I think there are probably a lot of provably-unneeded 
checks, and you could probably get rid of the byte-at-a-time reading. 

It would be interesting to see how much faster (if at all) it is to run the TR 
version of this code.

John


> On Feb 22, 2019, at 9:47 AM, Brian Craft  wrote:
> 
> I'm doing a few performance tests, just to get an idea of racket performance. 
> The following result surprised me a bit. Parsing 1M strings from a json 
> array, like
> 
> (define samples (time (read-json (open-input-file "test.json"
> 
> running with 'racket test.rkt'
> 
> Comparing to js, java, and clojure:
> 
> js 0.128s
> java 0.130s
> clojure 1.3s
> racket 10s
> 
> This is pretty slow. Is this typical? Are there other steps I should be 
> taking, for performance?
> 
> -- 
> You 

Re: [racket-users] How do you make students submit programming assignments online for automatic tests?

2019-02-20 Thread 'John Clements' via Racket Users
Github Classroom is trying to do this, but they’re not doing it well. I’ve used 
it several times, and managed to make it work, but the experience has been very 
me-programming-heavy, and not so great for the students. I think gradescope may 
have just merged with a company that’s trying to provide this. Their solution 
would definitely involve money.

One solution would be to use the command-line version of Racket’s 
handin-server, which is language-agnostic to the degree that it can just submit 
arbitrary files to the server, and what happens on the back end is up to you. 
It also has a web interface, though I don’t recall what it looks like; I 
haven’t used it in years.

I look forward to hearing about anything awesome that others use.

John




> On Feb 20, 2019, at 9:51 AM, Marc Kaufmann  wrote:
> 
> Hi all,
> 
> I will be teaching a course on data analysis in R next year (September), and 
> may at some point add some Racketeering to my other courses (maybe), and I 
> was wondering how those of you who teach programming classes deal with 
> programming assignments. Are there somewhat language-independent platforms 
> for having students submit assignments that have to pass a bunch of 
> pre-specified tests, or would I need to look at what is available for any 
> given platform? Any security issues I should be aware of?
> 
> All recommendations welcome,
> 
> Marc
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] mixed integer programming using glpk

2019-02-19 Thread 'John Clements' via Racket Users
I’m pleased to announce that I had a good reason to extend the glpk package to 
provide an interface to glpk’s mixed integer programming package; this means 
that if you can express your problem as a sequence of linear constraints on a 
set of variables where some of them need to be integers, you can use glpk to 
tackle this problem.

Docs here:

https://docs.racket-lang.org/glpk/index.html?q=glpk

install with “raco pkg install GLPK” or purchase wherever racket pkgs are sold.

Complaints and pull requests welcome!

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


pkgs still has no docs? (was: Re: [racket-users] Questions about Scribble docs)

2019-02-19 Thread 'John Clements' via Racket Users
Looks like… this is still the case? Specifically, reloading 
pkgs.racket-lang.org still shows that all packages are missing documentation. I 
thought I’d seen a message suggesting that this was resolved, but it appears I 
was mistaken.

John


> On Feb 16, 2019, at 8:08 PM, David Storrs  wrote:
> 
> On Sat, Feb 16, 2019 at 9:18 PM Greg Hendershott
>  wrote:
>> 
>> The package web site seems to think no packages have been built: The
>> "Most recent build results" item is blank for every of the dozen
>> packages I just checked.
> 
> Ah, that would do it.  Thanks.
> 
>> 
>> So I think that's one problem.
>> 
>> 
>> When that's working normally, as it usually does, there are two levels
>> of refresh:
>> 
>> 1. The package catalog server points to e.g. your most recent commit
>> on Git{Hub Lab}.com. You push a new commit. The package catalog might
>> take an hour before it notices. This is the thing you can "kick" by
>> logging in and choosing "Rescan my packges".
>> 
>> 2. The build server runs daily. This is what builds your docs as part
>> of building your package. So, even if it were working, now, it might
>> take 24 hours. There's no way to nudge this AFAIK.
>> 
>> 
>> On Sat, Feb 16, 2019 at 8:21 PM David Storrs  wrote:
>>> 
>>> Do I need to do something particular to make the package server notice
>>> my documentation?  I've got a scribblings/struct-plus-plus.scrbl file
>>> but the package server is still listing it as "needs documentation".
>>> 
>>> Separate but related, when I install a module and it builds the
>>> documentation, is there a way to make it integrate with the built-in
>>> docs so that I can load it in the browser and search?
>>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to racket-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Python's append vs Racket's append and helping novices understand the implications

2019-02-16 Thread 'John Clements' via Racket Users
I struggled with whether to send that message… I saw the name, “random access 
lists”, thought, “hmm, I wonder what that would like”, and clicked on the link. 
I wound up reading a bit about whether I should use (first impresssion) 
superficial or in-depth contracts, and ran out of steam pretty quickly. 
Ultimately, of course, the real issue is that your documentation wasn’t 
designed to help python programmers jump into their first experience with 
Racket, but a link to your documentation has essentially just made you an 
involuntary ambassador.


John

> On Feb 16, 2019, at 14:00, David Van Horn  wrote:
> 
> There are several examples for every function provided by the ralist library. 
>  (And it's almost verbatim what's in the Racket reference for pairs and 
> lists.)
> 
> But... I can add some early examples.  No problem.
> 
> David
> 
> On Sat, Feb 16, 2019, 4:00 PM John Clements  wrote:
> The pointer to RaLists would be much more enticing if we could convince David 
> Van Horn to begin his documentation with a couple of small examples…. 
> 
> John
> 
> > On Feb 13, 2019, at 14:35, Stephen De Gabrielle  
> > wrote:
> > 
> > Thanks 
> > 
> > I should note that anyone with a GitHub account can edit 
> > https://github.com/racket/racket/wiki/Python-to-Racket
> > 
> > S.
> > 
> > On Wed, 13 Feb 2019 at 21:26, Matthias Felleisen  
> > wrote:
> > 
> > Not until there’s demand. I think we do see demand for Python transfers. 
> > 
> > 
> > 
> > > On Feb 13, 2019, at 3:11 PM, Stephen De Gabrielle 
> > >  wrote:
> > > 
> > > Should there be similar pages for Javascript, Java,C#, C/C++, Ruby, PHP, 
> > > Visual Basic, Scratch and Haskell?
> > > 
> > > S.
> > > 
> > > On Wed, Feb 13, 2019 at 8:03 PM Stephen De Gabrielle 
> > >  wrote:
> > > I created a DRAFT page on the Racket GitHub wiki:
> > >   https://github.com/racket/racket/wiki/Python-to-Racket
> > > It links to a 'Choosing a data structure' page 
> > > https://github.com/racket/racket/wiki/Choosing-a-data-structure
> > > - this just as copy of the table created by Jens Axel Søgaard at: 
> > > https://stackoverflow.com/questions/27584416/in-racket-what-is-the-advantage-of-lists-over-vectors/27589146#27589146)
> > > 
> > > Please edit/delete as you see fit
> > > 
> > > Kind regards
> > > Stephen
> > > 
> > > 
> > > On Tue, Feb 12, 2019 at 5:20 PM Matthias Felleisen 
> > >  wrote:
> > > 
> > > This is perfect! Thanks — Matthias
> > > 
> > > 
> > > 
> > > 
> > > > On Feb 11, 2019, at 11:04 PM, Claes Wallin (韋嘉誠)  
> > > > wrote:
> > > > 
> > > > For anyone creating such a web page for Python to Racket specifically,
> > > > there is probably a great deal of inspiration, and reminders of
> > > > stumbling blocks, to be found in Arne Babenhauserheide's
> > > > https://www.draketo.de/py2guile book (available online for free) about
> > > > going from Python to Guile Scheme.
> > > > 
> > > > -- 
> > > >   /c
> > > > 
> > > > On Sun, Feb 3, 2019 at 7:00 AM Matthias Felleisen
> > > >  wrote:
> > > >> Racket needs *you*. Please.
> > > >> 
> > > >> The proper approach is to have short pages for different language 
> > > >> immigration groups: Python and R come to mind as obvious examples but 
> > > >> I am sure there are others.
> > > >> 
> > > >> What I mean is we need help and *you* can help. Let me explain it with 
> > > >> the Python example:
> > > >> 
> > > >> 1. Set up a page (wiki?) called “From Python to Racket”
> > > >> 
> > > >> 2. Create two sections that are immediately visible from the top:
> > > >> 
> > > >>— idioms
> > > >>— performance pitfalls
> > > >> 
> > > >> 3. In the specific case of Python, the second subsection needs to 
> > > >> start with a subsection on
> > > >> 
> > > >>— Python Lists aren’t Racket Lists
> > > >>— then point to data/ralis and show how to transliterate the 
> > > >> loop/append example like this
> > > >>— optionally also show the more native Racket idiom
> > > >> 
> > > >> 4. When anyone observers another blog/social media/whatever post on 
> > > >> Racket is slow because I come from Python,
> > > >> 
> > > >>(a) point the posters to the page  or
> > > >>(b) if it is a new case, write a section for this example then 
> > > >> do (a)
> > > >> 
> > > >> 
> > > >> If you want to help advertise Racket to others, this is an excellent 
> > > >> way of helping out.
> > > >> 
> > > >> Thanks — Matthias
> > > >> 
> > > >> [[ p.s. For my very first Python program (a couple of days before 
> > > >> meeting with GvR), I used Python’s append and was annoyed beyond 
> > > >> belief. ]]
> > > >> 
> > > >> 
> > > >> --
> > > >> You received this message because you are subscribed to the Google 
> > > >> Groups "Racket Users" group.
> > > >> To unsubscribe from this group and stop receiving emails from it, send 
> > > >> an email to racket-users+unsubscr...@googlegroups.com.
> > > >> For more options, visit https://groups.google.com/d/optout.
> > > > 
> > > > -- 
> > > > You 

Re: [racket-users] raco distribute creating too many subdirectories

2019-02-16 Thread 'John Clements' via Racket Users
Good to know; I also use define-runtime-path with abandon, and was not aware of 
possible consequences of casting too wide a net.

Thanks!

John

> On Feb 10, 2019, at 09:49, Philip McGrath  wrote:
> 
> I think this is probably a consequence of the quirk of `define-runtime-path` 
> with directories that I reported at: 
> https://github.com/racket/racket/issues/2336
> 
> I'm still not clear on whether the current behavior is intended and, if so, 
> how one ought to do this sort of thing to work robustly with the executable 
> creator.
> 
> -Philip
> 
> 
> On Sun, Feb 10, 2019 at 6:14 AM P. Baillet  wrote:
> Hello,
> 
> After some analysis, I found out this is because I was using 
> (define-runtime-path the wrong way. My code uses FFI and at some point, I 
> thought it would be wise to use code I didn’t understand.
> 
> The following snippet reproduces the issue:
> 
> #lang racket
> (require racket/runtime-path)
> 
> (define-runtime-path here ".")
> (displayln "Hi!")
> 
> I have reworked my code to no longer use this and it can now distribute my 
> application without problems.
> 
> On 9 Feb 2019, at 2:28, George Neuner wrote:
> 
> Why not build the executable separately and just copy it into the image?
> 
> Because I’m targeting another architecture.
> 
> Have a nice Sunday!
> -- 
> P.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Python's append vs Racket's append and helping novices understand the implications

2019-02-16 Thread 'John Clements' via Racket Users
The pointer to RaLists would be much more enticing if we could convince David 
Van Horn to begin his documentation with a couple of small examples…. 

John

> On Feb 13, 2019, at 14:35, Stephen De Gabrielle  
> wrote:
> 
> Thanks 
> 
> I should note that anyone with a GitHub account can edit 
> https://github.com/racket/racket/wiki/Python-to-Racket
> 
> S.
> 
> On Wed, 13 Feb 2019 at 21:26, Matthias Felleisen  
> wrote:
> 
> Not until there’s demand. I think we do see demand for Python transfers. 
> 
> 
> 
> > On Feb 13, 2019, at 3:11 PM, Stephen De Gabrielle  
> > wrote:
> > 
> > Should there be similar pages for Javascript, Java,C#, C/C++, Ruby, PHP, 
> > Visual Basic, Scratch and Haskell?
> > 
> > S.
> > 
> > On Wed, Feb 13, 2019 at 8:03 PM Stephen De Gabrielle 
> >  wrote:
> > I created a DRAFT page on the Racket GitHub wiki:
> >   https://github.com/racket/racket/wiki/Python-to-Racket
> > It links to a 'Choosing a data structure' page 
> > https://github.com/racket/racket/wiki/Choosing-a-data-structure
> > - this just as copy of the table created by Jens Axel Søgaard at: 
> > https://stackoverflow.com/questions/27584416/in-racket-what-is-the-advantage-of-lists-over-vectors/27589146#27589146)
> > 
> > Please edit/delete as you see fit
> > 
> > Kind regards
> > Stephen
> > 
> > 
> > On Tue, Feb 12, 2019 at 5:20 PM Matthias Felleisen  
> > wrote:
> > 
> > This is perfect! Thanks — Matthias
> > 
> > 
> > 
> > 
> > > On Feb 11, 2019, at 11:04 PM, Claes Wallin (韋嘉誠)  wrote:
> > > 
> > > For anyone creating such a web page for Python to Racket specifically,
> > > there is probably a great deal of inspiration, and reminders of
> > > stumbling blocks, to be found in Arne Babenhauserheide's
> > > https://www.draketo.de/py2guile book (available online for free) about
> > > going from Python to Guile Scheme.
> > > 
> > > -- 
> > >   /c
> > > 
> > > On Sun, Feb 3, 2019 at 7:00 AM Matthias Felleisen
> > >  wrote:
> > >> Racket needs *you*. Please.
> > >> 
> > >> The proper approach is to have short pages for different language 
> > >> immigration groups: Python and R come to mind as obvious examples but I 
> > >> am sure there are others.
> > >> 
> > >> What I mean is we need help and *you* can help. Let me explain it with 
> > >> the Python example:
> > >> 
> > >> 1. Set up a page (wiki?) called “From Python to Racket”
> > >> 
> > >> 2. Create two sections that are immediately visible from the top:
> > >> 
> > >>— idioms
> > >>— performance pitfalls
> > >> 
> > >> 3. In the specific case of Python, the second subsection needs to start 
> > >> with a subsection on
> > >> 
> > >>— Python Lists aren’t Racket Lists
> > >>— then point to data/ralis and show how to transliterate the 
> > >> loop/append example like this
> > >>— optionally also show the more native Racket idiom
> > >> 
> > >> 4. When anyone observers another blog/social media/whatever post on 
> > >> Racket is slow because I come from Python,
> > >> 
> > >>(a) point the posters to the page  or
> > >>(b) if it is a new case, write a section for this example then do 
> > >> (a)
> > >> 
> > >> 
> > >> If you want to help advertise Racket to others, this is an excellent way 
> > >> of helping out.
> > >> 
> > >> Thanks — Matthias
> > >> 
> > >> [[ p.s. For my very first Python program (a couple of days before 
> > >> meeting with GvR), I used Python’s append and was annoyed beyond belief. 
> > >> ]]
> > >> 
> > >> 
> > >> --
> > >> You received this message because you are subscribed to the Google 
> > >> Groups "Racket Users" group.
> > >> To unsubscribe from this group and stop receiving emails from it, send 
> > >> an email to racket-users+unsubscr...@googlegroups.com.
> > >> For more options, visit https://groups.google.com/d/optout.
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google Groups 
> > > "Racket Users" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to racket-users+unsubscr...@googlegroups.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
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] issue tracker for course management?

2019-02-14 Thread 'John Clements' via Racket Users
Okay, so this is Racket Users vs. Facebook (I’m asking this question in both 
places). I think racket-users will win, personally. Sorry for the fairly OT 
topic.

Here’s the question: Do any of you that run classes with multiple 
instructors/TAs/etc. use some kind of issue tracker to manage course issues? 
Ideally, it would be possible for students to submit issues but not to see 
them. Without this last requirement, I think nearly any issue tracker 
(github/bitbucket/etc.) would work. Any experience or advice?

Thanks in advance!

John Clements



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Molis hai documentation

2019-02-10 Thread 'John Clements' via Racket Users
Yes, this should appear in the web page. FWIW, raco commands come with a 
standard “—help” flag:

raco molis-hai --help
raco molis-hai [  ... ]
 where  is one of
  -b , --bits  : Number of bits of entropy
  -n , --passwords  : Number of passwords generated
  -o , --model-order  : Order of the model
  -t , --source-text  : Source text corpus
  --hyphens : replace whitespace with hyphens in source text
  --start-anywhere : use every point in the text as a candidate starting point
  --help, -h : Show this help
  -- : Do not treat any remaining argument as a switch (at this level)
 Multiple single-letter switches can be combined after one `-'; for
  example: `-h-' is the same as `-h —'

Again, though, this should appear in the web page.

John


> On Feb 10, 2019, at 06:25, Hendrik Boom  wrote:
> 
> The page
> https://docs.racket-lang.org/molis-hai/index.html
> specifies there are command line parameters, but does not say what they are.
> 
> In particular, I'm wondering how to specify:
>  the order
>  the number of bits of entropy
> 
> It does mention the -t flag to specify the source text.
> 
> It's not urgent to reply here; just put it into the web page and I'll find 
> it when I need it. 
> 
> -- 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.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Some concern about ChezScheme...

2019-02-09 Thread 'John Clements' via Racket Users



> On Feb 8, 2019, at 15:01, George Neuner  wrote:
> 
> On Fri, 8 Feb 2019 08:37:33 -0500, Matthias Felleisen
>  wrote:
> 
>> 
>>> On Feb 6, 2019, at 3:19 PM, George Neuner  wrote:
> 
>>> 
>>> The idea that a compiler should be structured as multiple passes each
>>> doing just one clearly defined thing is quite old.  I don't have
>>> references, but I recall some of these ideas being floated in the late
>>> 80's, early 90's [when I was in school].
>>> 
>>> Interestingly, LLVM began (circa ~2000) with similar notions that the
>>> compiler should be highly modular and composed of many (relatively
>>> simple) passes.  Unfortunately, they quickly discovered that, for a C
>>> compiler at least, having too many passes makes the compiler very slow
>>> - even on fast machines.  Relatively quickly they started combining
>>> the simple passes to reduce the running time. 
>> 
>> 
>> I strongly recommend that you read the article(s) to find out how
>> different nanopasses are from the multiple-pass compilers, which
>> probably date back to the late 60s at least. — Matthias
> 
> I did read the article and it seems to me that the "new idea" is the
> declarative tool generator framework rather than the so-called
> "nanopass" approach.  
> 
> The distinguishing characteristics of "nanopass" are said to be:
> 
> (1) the intermediate-language grammars are formally specified and
> enforced;
> (2) each pass needs to contain traversal code only for forms that
> undergo meaningful transformation; and
> (3) the intermediate code is represented more efficiently as records
> 
> 
> IRs implemented using records/structs go back to the 1960s (if not
> earlier).
> 
> 
> Formally specified IR grammars go back at least to Algol (1958). I
> concede that I am not aware of any (non-academic) compiler that
> actually has used this approach: AFAIAA, even the Algol compilers
> internally were ad hoc.  But the *idea* is not new.
> 
> I can recall as a student in the late 80's reading papers about
> language translation and compiler implementation using Prolog
> [relevant to this in the sense  of being declarative programming]. I
> don't have cites available, but I was spending a lot of my library
> time reading CACM and IEEE ToPL so it probably was in one of those.
> 
> 
> I'm not sure what #2 actually refers to.  I may be (probably am)
> missing something, but it would seem obvious to me that one does not
> write a whole lot of unnecessary code.


Hmm… I think I disagree.  In particular, I think you’re missing the notion of a 
DSL that allows these intermediate languages to be specified much more 
concisely by allowing users to write, in essence, “this language is just like 
that one, except that this node is added and this other one is removed.” I 
think it’s this feature, and its associated 
automatic-translation-of-untouched-nodes code, that makes it possible to 
consider writing a 50-pass parser that would otherwise have about 50 x 10 = 500 
“create a node by applying the transformation to the sub-elements” visitor 
clauses. Right?

In fact, as someone who’s about to teach a compilers class starting in April 
and who’s almost fatally prone to last-minute pivots, I have to ask: is anyone 
that you know (o great racket users list) currently using this approach or 
these tools? Last year I went with what I think of as the Aziz Ghuloum via Ben 
Lerner approach, starting with a trivial language and widening it gradually. I 
see now that Ghuloum was actually teaching at IU when he wrote his 2006 Scheme 
Workshop paper, and that although he cites about fifteen Dybvig papers, the 
nanopass papers don’t seem to be among them.

Hmm…

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


Re: [racket-users] Re: How To Design Classes text not available?

2019-02-02 Thread 'John Clements' via Racket Users
Also, if you use duckduckgo as your default search engine, it looks like you 
can prepend !archive or !wayback (turns out !a goes to amazon, sigh).

John

> On Feb 2, 2019, at 14:08, Neil Van Dyke  wrote:
> 
> Justin Zamora wrote on 2/2/19 3:39 PM:
>> Thanks! I always forget about archive.org!
> 
> Semi-off-topic, but this is helpful for Racketeers recovering older Scheme 
> docs/discussion/code (some of the best thinking happened many years ago, and 
> is still relevant)...
> 
> Here's a useful Firefox Quick Search bookmark:
> 
> Name:  [SEARCH] ARCHIVE.ORG
> Location:  https://web.archive.org/web/%S
> Keyword:  a
> 
> Basically, whenever you get a normal Web decay 404 error, or some kind of 
> anti-abuse/anti-privacy blocking by the server, you can go to your browser's 
> location (URL) bar, and prepend "a" with a space, and press Enter/Return.  No 
> add-on required.  (Also, you might want to set the location bar to not send 
> your typing and mis-pastes to search engines, and to only do autocomplete 
> from your bookmarks, not from history or anything else.)
> 
> 
> (Aside: This is especially helpful if you're running through Tor with JS 
> disabled by default, because some useful news sites, especially, will 
> actively refuse to serve pages to a Tor exit node IP address with JS 
> disabled, and one popular CDN will also refuse to serve pages to this, 
> whether or not its site customers know it. Offhand, I can think of only one 
> news site that is Tor-hostile without usually having news articles readable 
> in Archive.org.  Note that you're leaking a bit to Archive.org and bugs it 
> runs, of course.)
> 
> (Further aside: I try, when mentioning Tor, not to inadvertently endorse it 
> too much, given that its security has often been overstated, which could be 
> very bad for people who actually desperately need that security... I've been 
> experimenting with using Tor mainly as a free low/moderate-security VPN for 
> most daily desktop Web browsing, because even sketchy and likely-compromised 
> Tor nodes have better reputations than my ISP, :) and for techie continual 
> learning, and sense of obligation.  I previously ran a proxy tunnel through 
> EC2 for this purpose, but that's not great, either, and I wanted to find a 
> solution for people who can't afford an extra ~$5/mo.  Tor seems not-great 
> against some sophisticated adversaries, though, and the situation seems 
> almost hopeless with the current de facto Web architecture -- without even 
> blackbox traffic analysis, potentially large numbers of compromised nodes, or 
> general endpoint vulnerabilities.  But it's good for a little privacy from 
> your awful ISP, open WiFi, etc., if you don't mind it being slow, and if, 
> like me, you are boring enough that you don't mind your mere use of Tor 
> presumably raising your profile a bit for actors more-sophisticated than your 
> ISP or compromised cafe/hotel WiFi.  Also, Tor Browser is more consistently 
> privacy than the other browsers, with possible wait 
> exception of Brave.  Example warning for more general audiences is on 
> "https://www.neilvandyke.org/replicant/;.)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Spritely awarded Samsung Stack Zero grant

2019-01-31 Thread 'John Clements' via Racket Users
Truly excellent news! Can’t wait to hear about it at the next RacketCon.

John

> On Jan 31, 2019, at 14:46, Christopher Lemmer Webber  
> wrote:
> 
> I've mentioned that my goal has been to advance the
> federated/decentralized social web in Racket on here before.  Here's
> some news:
> 
>  
> https://samsungnext.com/whats-next/category/podcasts/decentralization-samsung-next-stack-zero-grant-recipients/
> 
> I'm being funded for the next two years to work on this stuff!  And I'm
> planning on doing it all in Racket.
> 
> In fact, I'm at a hackathon right now kicking it off, and I'm on the
> verge of releasing the first major demo.
> 
> Anyway, there's been some conversation about
> wouldn't-it-be-nice-if-more-people-were-paid-to-do-web-dev-in-racket
> so... here's one case! :)
> 
> I hope I can use this to help raise the profile of how great Racket
> is for this kind of work!
> 
> - 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.
> For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   5   >