SET!
SET! is a special form that evaluates its second argument and assigns that value to the defined variable which must be its first argument.
> (define x 0)
> (set! x (+ 1 2 3))
> x
6
> (define y 0)
> (set! y ’(+ 1 2 3))
> y
(+ 1 2 3)
> (set! y (rest y))
> (set! y (first y))
> y
1
Previous slide
Next slide
Back to first slide
View graphic version