#lang racket ;; more examples of let and let* ;; define global variables x and y (define x 100) (define y 200) ;; a simple let expression - notice the bindings for x and y in the expression (+ x y) (let ([x 5] [y 10]) (+ x y)) ;; in this let expression, the x in (+ x 1) is the global x, not the one bound to 5! (let ([x 5] [y (+ x 1)]) (+ x y)) ;; with let* the x in (+ x 1) is now the one bound to 5! (let* ([x 5] [y (+ x 1)]) (+ x y)) ;; converting the let* expression to one with nested lets (let ([x 5]) (let ([y (+ x 1)]) (+ x y)))