Re: [racket-users] Sharing scope in setup/cleanup for dynamic-wind?

2021-05-18 Thread Philip McGrath
On Tue, May 18, 2021 at 3:52 PM Sam Tobin-Hochstadt wrote: > I think the key question is what you want to happen if you would need > to re-run the "pre" thunk, because you re-enter the code via a > continuation. > > In many cases, you don't want to support that at all … > Then you can use `call-

Re: [racket-users] Sharing scope in setup/cleanup for dynamic-wind?

2021-05-18 Thread Sam Tobin-Hochstadt
I think the key question is what you want to happen if you would need to re-run the "pre" thunk, because you re-enter the code via a continuation. In many cases, you don't want to support that at all, and then it's pretty easy (although you still need mutation): (let* ([conn (connect-to-server)]

Re: [racket-users] Sharing scope in setup/cleanup for dynamic-wind?

2021-05-18 Thread David Storrs
Thank you. Is there a way to do it without the mutation? I was hoping to use this for macro generation that simplifies combining with-handlers and dynamic-wind with setup/teardown code. (try [pre (define db (connect-to-db)) (define conn (connect-to-server))] [(send-message conn

Re: [racket-users] Sharing scope in setup/cleanup for dynamic-wind?

2021-05-18 Thread Sam Tobin-Hochstadt
It's not quite as convenient, but here's a version of your program that should work: (let ([conn #f]) (dynamic-wind (lambda () (set! conn (connect-to-server)) (lambda () (send-message conn "foo")) (lambda () (finalize-connection conn Sam On Tue, May 18, 2021 at 2:08 PM David St

Re: [racket-users] recent sqlite3 versions (was Re: preview of a cross-compilation tool)

2021-05-18 Thread kamist...@gmail.com
> > > (So I guess the only question that comes up is: is it possible to update > > the sqlite version?) > > [vaguely remember seeing a mailing list thread about this but, currently > I > > only find other ones] > > My libsqlite3[1] package provides recent versions (currently 3.35.5) of > SQL

[racket-users] Sharing scope in setup/cleanup for dynamic-wind?

2021-05-18 Thread David Storrs
dynamic-wind is nice because it guarantees that the pre- and postconditions for a chunk of code will be run regardless of continuation jumps, exceptions, etc. The only issue I have is that the three thunks do not share scope, making it difficult to do setup/teardown workflows. I feel like I shoul

Re: [racket-users] I want a package at installation scope but also to keep my install clean

2021-05-18 Thread Sam Tobin-Hochstadt
You might also be interested in the new `raco-pkg-env` tool: https://github.com/samdphillips/raco-pkg-env/ Sam On Tue, May 18, 2021 at 12:20 PM Matthew Flatt wrote: > > Yes, this approach can work. I don't think the existing Racket tools > will help much with persisting a configuration across ve

[racket-users] recent sqlite3 versions (was Re: preview of a cross-compilation tool)

2021-05-18 Thread Bogdan Popa
kamist...@gmail.com writes: > (So I guess the only question that comes up is: is it possible to update > the sqlite version?) > [vaguely remember seeing a mailing list thread about this but, currently I > only find other ones] My libsqlite3[1] package provides recent versions (currently 3.35.5)

Re: [racket-users] I want a package at installation scope but also to keep my install clean

2021-05-18 Thread Matthew Flatt
Yes, this approach can work. I don't think the existing Racket tools will help much with persisting a configuration across versions, though, so you'd probably have to script that. One potential drawback of your approach is that executables, documentation, etc., associated with the extra package wi

Re: [racket-users] Re: preview of a cross-compilation tool

2021-05-18 Thread kamist...@gmail.com
utah has 32-bit Windows snapshots now again. I did a cross build with: >> Cross configuration Target:i386-win32 Host: x86_64-linux Version: current VM:bc Workspace: /tmp/todays-snapshot with `pkg install` `exe ...` `dist ...` moved dist over to windows vm and it ran fine,