Skip to content

Instantly share code, notes, and snippets.

@endobson
Created March 25, 2015 04:34
Show Gist options
  • Select an option

  • Save endobson/f410fcdca380fb855e20 to your computer and use it in GitHub Desktop.

Select an option

Save endobson/f410fcdca380fb855e20 to your computer and use it in GitHub Desktop.
Source:
(: f (Number [#:y Boolean] -> Number))
(define (f x #:y [y #f] #:z [z 'this-can-be-anything])
(if y "y is truthy" x))
Expanded inner function:
'(lambda (y1 y3 z2 z4 x5)
(let-values (((x) x5))
(let-values (((y) (if y3 y1 '#f)))
(let-values (((z) (if z4 z2 'this-can-be-anything)))
(let-values () (if y '"y is truthy" x))))))
Type we use to check it:
(case-> (-> Boolean True Nothing True Number Number) (-> False False False False Number Number))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment