Re: [racket-users] Re: Re-entrant parameterize modification isolation when using shift/reset

2021-07-30 Thread Greg Rosenblatt
nc2) (list (R) (Q) (displayln "with multiple algebraic states:") (J) ; 2 -2 (J) ; 2 -2 (J) ; 2 -2 ``` On Friday, July 30, 2021 at 11:04:09 AM UTC-4 Matthew Flatt wrote: > At Sun, 25 Jul 2021 10:35:00 -0700 (PDT), Greg Rosenblatt wrote: > > I was surprised that subsequent re

[racket-users] Re: Re-entrant parameterize modification isolation when using shift/reset

2021-07-29 Thread Greg Rosenblatt
Thanks for the response, Jack. I'm looking at: https://docs.racket-lang.org/reference/contmarks.html I don't see a way to update the value of an existing key without installing a new mark. Is it possible to do that? Parameters allow you to update the value associated with the innermost use

[racket-users] Re-entrant parameterize modification isolation when using shift/reset

2021-07-25 Thread Greg Rosenblatt
I'm using dynamic binding while also using delimited control operators such as shift and reset. When shift captures the context of a `parameterize`, I'd like to be able to resume that continuation in the same context multiple times without observing modifications caused by other resumptions.

Re: [racket-users] Top-level unbound identifiers during expansion

2021-06-28 Thread Greg Rosenblatt
> (name.r ...) (values))` to forward-declare all those names, and then > the subsequent definitions will work correctly. > > Sam > > [1] https://lists.racket-lang.org/users/archive/2005-November/010350.html > is a good short description of the problem here. > > On Fri,

[racket-users] Top-level unbound identifiers during expansion

2021-06-25 Thread Greg Rosenblatt
I've encountered an identifier binding order issue that only manifests in the REPL. My current workaround is to use forward definitions followed by set!s. I've heard rumors that the top-level is hopeless, but I'd like to try and make this work without unnecessary workarounds, if possible.

Re: [racket-users] Synchronizable conjunction of events?

2021-03-16 Thread Greg Rosenblatt
n some sense exactly what's requested here, the > andThen combinator mentioned here is what I think you originally requested: > http://www.cs.cornell.edu/people/fluet/research/tx-events/ > > Sam > > On Tue, Mar 16, 2021, 9:48 PM Greg Rosenblatt wrote: > >> Thank

Re: [racket-users] Synchronizable conjunction of events?

2021-03-16 Thread Greg Rosenblatt
Sam Tobin-Hochstadt wrote: > I think Aaron Turon's reagents (and more generally k-cas) are an example > of N-way rendezvous. > > Sam > > On Mon, Mar 15, 2021, 5:50 PM Matthew Flatt wrote: > >> At Mon, 15 Mar 2021 13:38:46 -0700 (PDT), Greg Rosenblatt wrote: >>

[racket-users] Synchronizable conjunction of events?

2021-03-15 Thread Greg Rosenblatt
Some context for my question: `choice-evt` constructs an event that behaves analogously to a logical disjunction, choosing any of its members that is ready for synchronization. Is there a corresponding event for a logical conjunction (I was looking for something like `all-evt` or `every-evt`),

Re: [racket-users] Possible bug when reading/writing large inexact numbers

2021-03-07 Thread Greg Rosenblatt
Great, thanks. Out of curiosity, where in the reader was this bug originally? Can you point me to a diff? On Sunday, March 7, 2021 at 8:42:33 PM UTC-5 sorawe...@gmail.com wrote: > This is already fixed. Racket 8.0 doesn't have this issue. > > On Mon, Mar 8, 2021 at 8:31 AM Greg R

[racket-users] Possible bug when reading/writing large inexact numbers

2021-03-07 Thread Greg Rosenblatt
Large inexact numbers may change values after a second round trip between read and write. I was expecting to reach a fixed point after the first round trip. Is this a bug? Welcome to Racket v7.8 [cs]. > 4.57030e+53 4.5703e+53 > 4.5703e+53 4.57029995e+53 -- You received this message

[racket-users] Creating threads that prevent main thread from exiting

2020-11-16 Thread Greg Rosenblatt
What is the best way to create threads that will prevent a program from exiting until they have completed their work? I'd like to be able to do this implicitly, without cooperation from the main thread. My first experiment uses `shift` to insert uses of `thread-wait` after the rest of the

[racket-users] Suspending/resuming threads with custodians/benefactors

2020-11-07 Thread Greg Rosenblatt
I'm experimenting with using custodians to manage threads (on Racket 7.8 [cs]) and encountering behavior I don't understand. I start a looping thread `t1` under a new custodian `c1`. I then shutdown `c1` and expect `t1` to stop looping. If I started `t1` with `thread` then this expectation is

Re: [racket-users] Can no longer interactively enter! module from the shell

2020-08-10 Thread Greg Rosenblatt
.0.7 [cs]. > loading example > "x.rkt"> example > 5 > "x.rkt"> > ``` > > Perhaps there was a problem with 7.3 that you're running into? Can you > try with the 7.8 release? > > Sam > > On Sun, Aug 9, 2020 at 8:33 PM Greg Rosenblatt &g

[racket-users] Can no longer interactively enter! module from the shell

2020-08-09 Thread Greg Rosenblatt
Given a module defined in example.rkt: ``` #lang racket/base (provide example) (displayln "loading example") (define example 5) ``` I used to be able to enter example.rkt with an interactive session from the shell like this: > racket -ie '(enter! "example.rkt")' Welcome to Racket v7.3.

Re: [racket-users] file->bytes with large files

2020-07-17 Thread Greg Rosenblatt
ime, use the > number of read bytes to increment a starting position into the > destination byte string (which is the third argument to `read-bytes!`). > > Matthew > > At Wed, 15 Jul 2020 15:05:22 -0700 (PDT), Greg Rosenblatt wrote: > > Hi, I'm getting an error whi

[racket-users] file->bytes with large files

2020-07-15 Thread Greg Rosenblatt
Hi, I'm getting an error while using file->bytes to load a moderately large file: > (time (void (file->bytes "my-7.6GB-file"))) ; error reading from stream port ; port: # ; system error: Invalid argument; errno=22 ; context...: ;/Applications/Racket v7.7/collects/racket/file.rkt:768:6:

Re: [racket-users] Unbound identifier error with syntax transformer that uses syntax-generating helper procedure

2018-05-08 Thread Greg Rosenblatt
does: it is like for-syntax, but it shifts > imports a phase level down instead of a phase level up. > > (Note that (for-template (for-syntax )) is a no-op, since the shifts > cancel each other out. It may be educational to think about the > implications of this for your

[racket-users] Unbound identifier error with syntax transformer that uses syntax-generating helper procedure

2018-05-08 Thread Greg Rosenblatt
Hi, I'm having trouble writing a syntax transformer that uses a syntax-generating procedure defined elsewhere. When the procedure is defined locally, everything is fine. When the procedure is defined outside the transformer, I have to do a dance to make the procedure visible at the right

[racket-users] Unexpected pattern matching behavior

2018-04-25 Thread Greg Rosenblatt
I'm confused by the behavior of pattern matching in some cases. I'll discuss a few sets of examples involving segment patterns, then a mix of `and`, `or`, and `not` patterns. Here is a basic segment pattern matching the entire contents of a list: > (match '(1 2 3) ((list x ...) `(result:

[racket-users] Unexpected quasiquote and quasisyntax behavior

2018-04-24 Thread Greg Rosenblatt
I'm confused about the behavior of quasiquote and quasisyntax in some cases (using Racket v6.10.1). I'll list some examples alongside my questions. This vector quasiquote behavior makes sense to me: > `#(3 ,@'(4)) '#(3 4) The analogous quasisyntax gives an error, which seems strange. What's

[racket-users] Scopes and shadowing syntax-rules literals

2018-01-04 Thread Greg Rosenblatt
Hi, I've been experimenting with various corner cases of the macro system to better understand the implementation. For comparison, I've also been running the experiments in Chez Scheme. I found a difference of opinions when running the following two tests. The idea is to test under what