O'Reilly logo

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Interchangeability

As a value type is copied when it is assigned to a new variable, all of those copies are completely interchangeable.

We can safely store a value that is passed to us, and then later utilize this value as if it were a new value. It will not be possible to compare the instance with another instance using anything but its data.

Interchangeability also means that it does not matter how a given value was defined. Two value types are equal by all means if comparing them via == results in equality.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required