Setting default argument value in Racket
Is it possible to set a def开发者_高级运维ault value to some of arguments in Racket?
Like so in Python:
def f(arg=0)
...
Yes; take a look at: declaring optional arguments.
For example:
(define (f [arg 0])
(* arg 2))
Racket also supports functions with keyword arguments. The link should lead to documentation that talks about them too. Good luck!
精彩评论