tgallice / wit-php

Wit.ai php sdk
MIT License
68 stars 16 forks source link

Define Context as Immutable #16

Open tgallice opened 8 years ago

tgallice commented 8 years ago

I think the Context must be immutable to prevent side effects. This way we can track all context modifications and why not provide a history ?

hfinck commented 8 years ago

Can you elaborate on this? At least within the action mapping we want to modify context data, since this is what helps wit.ai to predict the next actions.

tgallice commented 8 years ago

What I mean it's we should not update the current Context but return a new Context with previous value and new one added. It's just to prevent side effets.