boudhayan
3/31/2018 - 7:17 PM

StepIncreaser.Swift

let stepIncreaser = MorningWalk.addSteps(_:)
let stepDecreaser = MorningWalk.minusSteps(_:)

stepIncreaser(sundayMorningWalk)(200) // Now 'steps' becomes 300
stepDecreaser(sundayMorningWalk)(50) // Now 'steps' becomes 250
print(sundayMorningWalk.steps) //It prints 250