Question: please write in DrRacket or Racket you will work the little la nguage ::= | (lambda ( ) ) | ( ) | (let (

please write in DrRacket or Racket

you will work the little language

  ::=  | (lambda () ) | ( ) | (let ( ) )

Write a structurally recursive function named (free-vars exp) that takes as input an expression in the core language, and returns a set of all of the variables that occur free in expression. For example:

 > (free-vars 'x) (x) > (free-vars '(square x)) (x square) > (free-vars '(lambda (y) (x y))) (x) > (free-vars '((lambda (y) (y (square x))) (lambda (y) (f y)))) (f x square) > (free-vars (preprocess '(let (a b) (let (c (lambda (d) a)) (c a)))) (b)

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!