[racket-users] ‘with-limits’ doesn’t stop subprocesses

2018-08-05 Thread 'Leandro Facchinetti' via Racket Users
Hi, I want to run a subprocess with a timeout. Here’s what I tried: #lang racket (require racket/sandbox) (with-handlers ([exn:fail:resource? (λ (e) (displayln "Timed out"))]) (with-limits 5 #f (system "sleep 10 && echo Finished"))) This doesn’t work, it prints both “Timed out” after 5

Re: [racket-users] Parameterized Redex models

2018-03-15 Thread 'Leandro Facchinetti' via Racket Users
> Robby’s message dominates mine but I don’t get why you can’t work your way > thru what I provided. > I don’t see the connection between the issue I brought up and what you provided. In your program ‘r-r/tick’ is a form to define a reduction relation which manages ‘clock’, but then ‘clock’

Re: [racket-users] Parameterized Redex models

2018-03-15 Thread 'Leandro Facchinetti' via Racket Users
This is going further in the wrong direction  1. The cache for the reduction relation is invalid. 2. There’s no way to parameterize ‘clock’ when calling the reduction relation (I think it’d really help to think of ‘k’ instead of ‘clock’). 3. ‘clock’ isn’t available to metafunctions called

Re: [racket-users] Parameterized Redex models

2018-03-15 Thread 'Leandro Facchinetti' via Racket Users
I see how this makes typesetting work. But I’m sorry but I don’t see how this program addresses any of my concerns: ‘clock’ is still unavailable to when defining ‘go’; and worse, there’s no way to set it from the outside. -- You received this message because you are subscribed to the Google

Re: [racket-users] Parameterized Redex models

2018-03-15 Thread 'Leandro Facchinetti' via Racket Users
> Stepping back a little bit here, if you were to write this down in a > way that were to make sense to a reader of a paper, how would you > communicate with them how/when this parameter changes? > When defining metafunctions/reduction relations/judgment forms and so on, authors generally

Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users
> Yes, it looks like the original cache is just re-installed when re-enabled. > > Perhaps there should be an operation provided by Redex to clear away the > cache. > That’s one my proposals, yes  (see § Solutions on my original message) -- You received this message because you are

Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users
First, thanks for the reply. It’s valuable to have the author of the paper from where I draw my example chime in  1) Instead of turning the cache off completely, you could just invalidate the cache when the parameter changes, i.e. write a `set-k!' function that updates the parameter and

Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users
> What if you wrote macros over reduction-relation instead of the exact > model? These macros could implement threading and hide it. They would kind > of be like monads here. — Matthias > Do you mean something like (define-parameterized-metafunction (k) L tick : e _ _ _ t -> t

Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users
A related question is > to ask if maybe the parameter is intended to be so "dyanmic". Maybe > you should have to recompile the redex program to change the parameter > sometimes because, after all, if runs of the abstract machine with > different values of `k` interact with each other, maybe

Re: [racket-users] Parameterized Redex models

2018-03-14 Thread 'Leandro Facchinetti' via Racket Users
Thanks for the clarification, I think I understand your proposal. And I see three problems: 1. I believe ‘traces/t’ is the evidence of the issue I brought up earlier: How do call sites know the form expects the extra argument? As your example demonstrates, call sites need to be explicit about

Re: [racket-users] Parameterized Redex models

2018-03-16 Thread 'Leandro Facchinetti' via Racket Users
> But I clearly don’t get what you really want so I will abandon this one. > > Good luck — Matthias > Thanks for trying, talking to you is always instructive  For people that hasn’t abandoned this one: I decided to bite the bullet and thread the ‘metaparameter’ in my definitions. This will

Re: [racket-users] Parameterized Redex models

2018-03-16 Thread 'Leandro Facchinetti' via Racket Users
As far as I understand, your ‘length-ok’ is implementing in Redex the ‘(<= (length ___) ___)’ I had in my ‘side-condition’. But I can’t see how it addresses two important features from my original code: (1) ‘k’ is parameterizable, and its value influences whether a list is valid or not; and

[racket-users] Playing the Game with PLT Redex · Second Edition

2018-09-30 Thread 'Leandro Facchinetti' via Racket Users
Hi Racketeers, I while ago I wrote a short article in which I used PLT Redex to play a game of Peg Solitaire. I now present you the extended version of that article: https://www.leafac.com/prose/playing-the-game-with-plt-redex/

Re: [racket-users] Criação dinâmica de perguntas

2018-10-02 Thread 'Leandro Facchinetti' via Racket Users
O código que você mostrou primeiro cria uma variável chamada que com valor inicial "questao_solve" (uma string). Depois a variável que tem o valor mudado para um radio-box% (um objeto). Perceba que questao_solve nunca foi uma variável, então tentar mandar a mensagem get-value para ele resulta

Re: [racket-users] The performance of ‘set’ vs. lists+‘remove-duplicates’

2018-12-05 Thread 'Leandro Facchinetti' via Racket Users
The sets are about 20 elements in size. It seems that ‘member’ before ‘cons’ is marginally faster than ‘remove-duplicates’ after ‘cons’, as one would expect. But it’s the strangest thing: in some cases switching from sets to lists with unique elements changes the meaning of the program! I

[racket-users] The performance of ‘set’ vs. lists+‘remove-duplicates’

2018-12-04 Thread 'Leandro Facchinetti' via Racket Users
I rewrote a codebase that was using ‘set’s to use lists that I ‘remove-duplicates’ whenever I ‘cons’. The result is orders of magnitude faster. Do you have any idea why? -- Leandro Facchinetti https://www.leafac.com -- You received this message because you are subscribed to the Google

Re: [racket-users] The performance of ‘set’ vs. lists+‘remove-duplicates’

2018-12-06 Thread 'Leandro Facchinetti' via Racket Users
In my program, hashes are only 20% faster than sets containing approximately 20 elements that are S-expressions. I solved the mystery of why switching to lists with unique elements made things faster and in some cases even changed the meaning of the program. I always thought that my program

[racket-users] Weird behavior when a ‘set’ is the result of ‘eval’

2019-01-10 Thread 'Leandro Facchinetti' via Racket Users
Please help me understand the following: #lang racket (define s (eval '(begin (require racket/set) (set 1 2)) (make-base-namespace))) s ;; ⇒ (set 1 2) (set? s) ;; ⇒ #f (but I expected ‘#t’) -- Leandro Facchinetti https://www.leafac.com -- You received this message because you are subscribed

Re: [racket-users] Weird behavior when a ‘set’ is the result of ‘eval’

2019-01-10 Thread 'Leandro Facchinetti' via Racket Users
 Got it. Thanks. -- Leandro Facchinetti https://www.leafac.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. For

Re: [racket-users] Racket Week’s website looks strange now that the registration is open

2019-02-01 Thread 'Leandro Facchinetti' via Racket Users
> It's decrementing, isn't it? It just says since how long it's open I guess :) Yes, I mistyped—it’s decrementing. I think you should be saying “Registration is open «Link for registration»”. -- Leandro Facchinetti https://www.leafac.com -- You received this message because you are