#2: Conditional Mutation

Tagged as challenge

Written on 2018-01-30

Create a procedure called set-if! such that

(set-if! <predicate> <symbol> <value>)

means that <symbol> is not set to <value> if <predicate> is not true.

Follow up questions:

  1. Why can't this be a function in most languages?

  2. What are the subtlties of the semantics of this? What behavior is not defined by the above?

Unless otherwise credited all material copyright © 2010–2018 by Robert Smith