~williewillus/r16

r16/utils.rkt -rw-r--r-- 294 bytes
d426a80dVincent Lee Expose replied-to message contents 11 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#lang racket/base

(require (for-syntax racket/base syntax/parse))

(provide thread-loop)

(define-syntax (thread-loop stx)
  (syntax-parse stx
    [(_ body:expr ...)
     (syntax/loc stx
       (let ()
         (define (loop)
           body ...
           (loop))
         (thread loop)))]))