Designing Functions that Change Structures

Sections~#secencapsulate#54215> and~#secmutable#54216> gradually introduced the idea of mutable structures. In the first of the two sections we studied the idea of changing a <#69452#><#54217#>local<#54217#><#69452#>ly defined variable through a function. In the second one, we discussed how structures could be modified, too. Now we need to learn when and how to use this new power. The first subsection concerns the question why a program should modify a structure. The second reviews how the existing design recipes apply when we wish to use mutators. The third one discusses some difficult cases. The last one is dedicated to the differences between <#69453#><#54218#>set!<#54218#><#69453#> and structure mutators.