Skip to content

Instantly share code, notes, and snippets.

@atmb4u
Created April 12, 2015 09:39
Show Gist options
  • Save atmb4u/cefbe3d355bab26cc02a to your computer and use it in GitHub Desktop.
Save atmb4u/cefbe3d355bab26cc02a to your computer and use it in GitHub Desktop.
Function Pipelines with persistent State (FPS) - FPS programming
b = WaterBottle()
b.add_water(300)
b.drink_water(200)
b.drink_water(700)
b = WineBottle()
b.add_wine(300)
b.drink_wine(200)
b.drink_wine(700)
b = Bottle()
name_bottle(b, "Water")
fill(b, 300)
drink(b, 200)
b = Bottle()
name_bottle(b, "Wine")
fill(b, 200)
drink(b, 700)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment