switching machines

This commit is contained in:
Robby Findler 2010-07-31 14:27:02 -05:00
parent d75536161c
commit efd72af3d6

View File

@ -1,6 +1,33 @@
#lang racket/base #lang racket/base
(require racket/contract) (require racket/contract)
#;
(->i ([x number?]
[y (x) (<=/c x)])
any)
#;
(define (coerce-proj x)
...)
#;
(build-->i
(list number?)
(list (λ (x pos neg blame info) (coerce-proj (<=/c x) pos neg blame info)))
(λ (x/c y/proc) ;; <= arguments are in strange order: first the non-dependent things, then the dependent things
(λ (pos neg blame info)
(let ([here ...])
(let ([x/proj (x/c neg pos blame info)]
[x/proj/i (x/c here pos blame info)])
(λ (f)
(λ (x y)
(let ([x (x/proj x)]
[xi (x/proj/i x)])
(let ([y (y/proc xi neg pos blame info)]
[y (y/proc xi here pos blame info)])
(f x y))))))))))
(syntax->datum (expand #'(-> number? (<=/c 10) any)))
#| #|
test cases: test cases: