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
Get step-by-step solutions from verified subject matter experts
