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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!