Skip to content

Instantly share code, notes, and snippets.

@frenchy64
Created August 3, 2011 17:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frenchy64/1123268 to your computer and use it in GitHub Desktop.
Save frenchy64/1123268 to your computer and use it in GitHub Desktop.
(deftyped
addInteger
[Integer :> [Integer :> Integer]]
[x y]
(+ x y))
(deftyped
addDouble
[Double :> [Double :> Double]]
[x y]
(+ x y))
(deftyped
maxDouble
[Double :> [Double :> Double]]
[x y]
(max x y))
(type-check-form
'(maxDouble (addDouble 1.0 2.0)
(addDouble 2.0 3.0)))
;=> (true)
(type-check-form
'(maxDouble (addDouble 1 2.0)
(addDouble 2.0 3.0)))
;=> ()
(type-check-form
'(addDouble 1.1 2.1))
;=>(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment