handle sets in any-wrap/c

original commit: 3ae298b14504be101713692ab7e3169841670a09
This commit is contained in:
Sam Tobin-Hochstadt 2013-10-30 14:25:44 -04:00
parent 11eeb1a4ad
commit ad1db428d3

View File

@ -1,7 +1,7 @@
#lang racket/base
(require racket/match racket/contract/base racket/contract/combinator
racket/promise)
racket/promise racket/set)
(define undef (letrec ([x x]) x))
@ -84,6 +84,10 @@
(lambda (h v) v) ;; remove
(lambda (h k) (t k)))] ;; key
[(? evt?) (chaperone-evt v (lambda (e) (values e t)))]
[(? set?)
(for/set ([i (in-set v)]) (t i))]
;; could do something with generic sets here if they had
;; chaperones, or if i could tell if they were immutable.
[(? struct?) (wrap-struct v)]
[(? procedure?)
(if (procedure-arity-includes? v 0)