Skip to content

Instantly share code, notes, and snippets.

@Metaxal
Last active December 29, 2015 07:39
Show Gist options
  • Save Metaxal/7638046 to your computer and use it in GitHub Desktop.
Save Metaxal/7638046 to your computer and use it in GitHub Desktop.
def-jambda with signatures next to the body
(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