Created
October 19, 2012 20:31
-
-
Save dyoo/3920553 to your computer and use it in GitHub Desktop.
maybe a bug in typed racket?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang typed/racket/base | |
;; These are the primitives that we know how to inline. | |
(define-type KernelPrimitiveName/Inline (U '+ | |
'- | |
'* | |
'/ | |
'zero? | |
'add1 | |
'sub1 | |
'< | |
'<= | |
'= | |
'> | |
'>= | |
'cons | |
'car | |
'caar | |
'cdr | |
'list | |
'list? | |
'pair? | |
'null? | |
'not | |
'eq? | |
'vector-ref | |
'vector-set! | |
)) | |
(: operator->string (KernelPrimitiveName/Inline -> String)) | |
(define (operator->string operator) | |
(case operator | |
[(+) | |
"+"] | |
[(-) | |
"-"] | |
[(*) | |
"*"] | |
[(/) | |
"/"] | |
[(zero?) | |
"zero?"] | |
[(add1) | |
"add1"] | |
[(sub1) | |
"sub1"] | |
[(<) | |
"<"] | |
[(<=) | |
"<="] | |
[(=) | |
"="] | |
[(>) | |
">"] | |
[(>=) | |
">="] | |
[(cons) | |
"cons"] | |
[(car) | |
"car"] | |
[(caar) | |
"caar"] | |
[(cdr) | |
"cdr"] | |
[(list) | |
"list"] | |
[(list?) | |
"list?"] | |
[(pair?) | |
"pair?"] | |
[(null?) | |
"null?"] | |
[(not) | |
"not"] | |
[(eq?) | |
"eq?"] | |
[(vector-ref) | |
"vector-ref"] | |
[(vector-set!) | |
"vector-set!"])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment