2.17 Assignment: set! and set!-values
|(set! id expr)|
Otherwise, evaluates expr and installs the result into the location for id, which must be bound as a local variable or defined as a top-level variable or module-level variable. If id refers to an imported binding, a syntax error is reported. If id refers to a top-level variable that has not been defined, the exn:fail:contract exception is raised.
See also compile-allow-set!-undefined.
|> (set! x (add1 x))|
|> (set! i-am-not-defined 10)|
set!: cannot set undefined variable: i-am-not-defined
|(set!-values (id ...) expr)|
More generally, the set!-values form is expanded to
|(let-values ([(tmp-id ...) expr])|
|(set! id tmp-id) ...)|
which triggers further expansion if any id has a transformer binding to an assignment transformer.