Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started