Question: [Default parameters] In this question you will explore a semantic variation of function call and return. A function definition can provide default values for the
[Default parameters] In this question you will explore a semantic variation of function call and return. A function definition can provide default values for the functions parameters. Extend the Funclang interpreter with java to support functions with the default value for their last parameters (not all parameters).
The following interaction log illustrates the syntax and semantics for our desired extension:
$ (define func (lambda ((v = 342)) v) )
$ (func)
342
$ (func 541)
541
$ (define add (lambda (a (b = 5)) (+ a b)) )
$ (add 8)
13
$ (add 8 4)
12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
