PasteRack.org
Paste # 63115
2019-07-03 08:38:04

Forked from paste # 21529.

Fork as a new paste.

Paste viewed 551 times.


Embed:

how to define a default parameter value for a function in t/r?

  1. #lang typed/racket
  2.  
  3. ;; how to define a default parameter value for a function in t/r?
  4.  
  5. (define (foo [bar : Any 0])
  6.   bar)
  7.  
  8. (foo 1) ; succeeds
  9. (foo) ; type checker error: wrong number of arguments!

=>

- : Any

1

- : Any

0