Last active
December 29, 2015 07:39
-
-
Save Metaxal/7638046 to your computer and use it in GitHub Desktop.
def-jambda with signatures next to the body
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
(defn | |
#:doc @list{Multiplies @racket[x] by @racket[y]. | |
Use it fruitfully.} | |
#:ex [10 3 => 30] | |
#:ex [0 3 => 0] | |
#:ex [10 => 10] | |
#:ex [0 => 0] | |
;; The function signature | |
(mult [x number?][y number? 1] -> number?) | |
;; And the function body: | |
(* x 3)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment