You can declare "local" variables in Racket via the use of the let function. For example, try the following code:
(define a 2);;binding a variable to a value
(define b 3)
(define c 4)
(define (strange x)
(let ((a 1) (b 2))
(+ x a b))))
After executing this code, what are the values of a, b, and c? What is the return value when you make the call (strange 4)? Explain your answers.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here