The method assign replaces each components with the result of a closure (that takes the corresponding component as parameter).