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

2018-08-05 Thread Matthew Flatt
I must have tried it wrong the first time, because I see what you see. I'm surprised that `with-limits` doesn't shut down a custodian on a timeout, but you can set up that termination yourself: (parameterize ([current-subprocess-custodian-mode 'kill] [current-custodian

[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] Redex: custom rendering of metafunctions

2018-08-05 Thread Robby Findler
The primary way to customize metafunction rendering is through `with-atomic-rewriters` and `with-compound-rewriters`. Depending on exactly what you have in mind, you can get close to what you suggest, I suppose. Robby On Sat, Jul 21, 2018 at 4:30 AM, Stephen Foster wrote: > I see

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

2018-08-05 Thread Matthew Flatt
At Fri, 20 Jul 2018 16:28:22 -0400, "'Leandro Facchinetti' via Racket Users" wrote: > 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

Re: [racket-users] How do I find the current phase level?

2018-08-05 Thread Matthew Flatt
You can use `(variable-reference->phase (#%variable-reference))`. At Fri, 20 Jul 2018 17:03:27 -0400, David Storrs wrote: > How can I answer the question "what phase level is this chunk of code > running at?" > > For example: > > (displayln (~a "current phase level: " (current-phase-level)))

Re: [racket-users] Hierarchically-correct Scribble documentation

2018-08-05 Thread Philip McGrath
To rebuild an installed package/collection, including documentation, you want the `raco setup` command. In general, `raco setup my-collection` builds everything for `my-collection`. You will often also want the `--doc-index` flag to rebuild the index for the local documentation. The full range of

[racket-users] Redex: custom rendering of metafunctions

2018-08-05 Thread Stephen Foster
I see metafunction->pict. It's basically what I want for a game I'm designing. It renders metafunction like this: However, I was wondering if there's a way

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

2018-08-05 Thread Philip McGrath
I thought `current-subprocess-custodian-mode` would be the solution, but when I just tried your code (with Racket 6.12 on Mac OS), it first printed "Timed out", then printed “Finished” after a brief delay. I get the same result if I put the `parameterize` directly around the call to `system`, and

[racket-users] How do I find the current phase level?

2018-08-05 Thread David Storrs
How can I answer the question "what phase level is this chunk of code running at?" For example: (displayln (~a "current phase level: " (current-phase-level))) ; outputs 0 (begin-for-syntax (displayln (~a "current phase level: " (current-phase-level))) ; outputs 1 ) Long version: I'm having

Re: [racket-users] Is this a bug in pict library?

2018-08-05 Thread 曹朝
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. For more options, visit

Re: [racket-users] Is this a bug in pict library?

2018-08-05 Thread Matthew Flatt
Your drawing function is ignoring the `dx` and `dy` arguments, so the second instance of `t1` doesn't shift as it should (i.e., `dy` will be non-zero). At Sun, 5 Aug 2018 12:58:53 -0700 (PDT), 曹朝 wrote: > *Please help:* > >

Re: [racket-users] Trying to understand the module system.

2018-08-05 Thread Alex Gian
Looking over the Racket namespace routines, I think I can get them to map pretty much exactly to the way *scmutils* uses environments. Not as bad as I expected, in fact I think it might be relatively easy. I have never worked with namespaces in this way before, but even so everything seems

[racket-users] Is this a bug in pict library?

2018-08-05 Thread 曹朝
*Please help:* The bottom part of the picture disappeared. Why "vc-append" behaves like

Re: [racket-users] how to display all paths of a tree without repetitions

2018-08-05 Thread Matthias Felleisen
I“d write it like this: (struct tree (val left right) #:transparent) ;; Tree = '() | (tree X Tree Tree) (define (printer t0) (local (;; from-t0 : the path from t0 to t (define (printer/acc t from-t0) (cond [(empty? t) (map display (reverse

[racket-users] how to display all paths of a tree without repetitions

2018-08-05 Thread Robert Girault
I have this tree[1]: (tree '(game A B) (tree '(game A C) '() (tree '(game C B) '() (tree '(game B A) '() '( (tree '(game B C) '() (tree '(game C A) '() (tree '(game A B) '() '() This is how I'd like to print it out: ;; (game A B) --> (game A C) --> end ;; (game A B) --> (game A C)

Re: [racket-users] Is it possible to embed a scheme'y text editor in another GUI application?

2018-08-05 Thread David Thrane Christiansen
Hi Christopher, > Oh, this is very nice! I didn't even know there was a way to embed a > REPL like this in slideshow! :) It's possible to embed arbitrary GUI widgets! Here's a talk that uses Slideshow with an embedded Idris editor and REPL where the slides fire up an Idris compiler behind the

Re: [racket-users] Is it possible to embed a scheme'y text editor in another GUI application?

2018-08-05 Thread Christopher Lemmer Webber
Matthew Flatt writes: > At Sun, 05 Aug 2018 11:50:09 -0400, Christopher Lemmer Webber wrote: >> DrRacket includes a nice Scheme editor. I don't need the whole >> thing... but some of it would be nice, like the paren matching. How >> reusable is DrRacket's text editor tooling? Reusable enough

Re: [racket-users] RWind - Racket X window manager - by Laurent Orseau

2018-08-05 Thread Christopher Lemmer Webber
Neil Van Dyke writes: > There's a way to control it from a Racket REPL or other process: > https://github.com/Metaxal/rwind/blob/master/README.md#the-client Ah great, thanks I missed this bit :) -- You received this message because you are subscribed to the Google Groups "Racket Users" group.

Re: [racket-users] W7 security kernel / object capaiblities in Racket

2018-08-05 Thread Christopher Lemmer Webber
Matthew Flatt writes: > At Sun, 05 Aug 2018 11:40:25 -0400, Christopher Lemmer Webber wrote: >> Eventually I would like to write a multiplayer game in Racket where >> users can write and execute code safely [...] >> >> In a sense, it would sound as if Racket's #lang support would be perfect >>

Re: [racket-users] RWind - Racket X window manager - by Laurent Orseau

2018-08-05 Thread Neil Van Dyke
This is from the minimalist foundation for customization school of thought.  Your screenshot would look XMonad or an undecorated TWM, not Enlightenment. There's a way to control it from a Racket REPL or other process: https://github.com/Metaxal/rwind/blob/master/README.md#the-client Reasons

Re: [racket-users] Is it possible to embed a scheme'y text editor in another GUI application?

2018-08-05 Thread Matthew Flatt
At Sun, 05 Aug 2018 11:50:09 -0400, Christopher Lemmer Webber wrote: > DrRacket includes a nice Scheme editor. I don't need the whole > thing... but some of it would be nice, like the paren matching. How > reusable is DrRacket's text editor tooling? Reusable enough to embed in > another

Re: [racket-users] W7 security kernel / object capaiblities in Racket

2018-08-05 Thread Matthew Flatt
At Sun, 05 Aug 2018 11:40:25 -0400, Christopher Lemmer Webber wrote: > Eventually I would like to write a multiplayer game in Racket where > users can write and execute code safely [...] > > In a sense, it would sound as if Racket's #lang support would be perfect > for this. But in fact there is

[racket-users] Is it possible to embed a scheme'y text editor in another GUI application?

2018-08-05 Thread Christopher Lemmer Webber
DrRacket includes a nice Scheme editor. I don't need the whole thing... but some of it would be nice, like the paren matching. How reusable is DrRacket's text editor tooling? Reusable enough to embed in another application? Or would I have to rewrite this? I know I can embed a more vanilla

[racket-users] W7 security kernel / object capaiblities in Racket

2018-08-05 Thread Christopher Lemmer Webber
It's not urgent, but an item on my TODO list is to port Jonathan Rees' W7 Security Kernel to Racket. Basically this is an object capability security system based on the lambda calculus (as Scheme). Object capability security is a security system which applies the principle of least authority on

Re: [racket-users] RWind - Racket X window manager - by Laurent Orseau

2018-08-05 Thread Christopher Lemmer Webber
BTW, for some time I was an active user of StumpWM, a tiling window manager of Common Lisp. The nicest thing about it was that, like emacs, you could edit it while it was running. I assume the same thing is not possible in RWind? Do you usually have to stop and restart the whole thing every

Re: [racket-users] RWind - Racket X window manager - by Laurent Orseau

2018-08-05 Thread Christopher Lemmer Webber
Screenshots certainly don't tell much, but I'd be curious to see what a screenshot looks like anyway if you don't mind sharing one of yours :) -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving