I wanted to understand a limitation of the repl of the rash package (github 
issue https://github.com/willghatch/racket-rash/issues/78) as well as in the 
racket repl, i guess, and see if i could do a quick hack to get something 
working.

Anyway, i just wanted to catch SIGINT without using something like the 
`unix-signals` package from Tony Garnock-Jones. I just did this:

```
(module blah racket
  (let loop ()
    (define (read k)
      (with-handlers ([exn:break? (λ (e) (display "=BREAK=") (k #f))])
        (k (read-line))))

    (display "> ")
    (let ([result (call/cc read)])
      (when result
        (display result))
      (newline)
      (loop))))
```

1) It catches all breaks and my program won't quit =). Is there a way to 
discern if the break is a SIGINT so i can continue only on that signal and 
abort otherwise? I guess, should i just check that it's not a 
exn:break:terminate or exn:break:hang-up, or... ?

2) Are there any glaring mistakes in what i wrote other than the problems of 
(1)?

Any good way to do this?

Nate

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20A87695-C978-435A-9D6B-182B7D565D96%40manicmind.earth.

Reply via email to