Can we keep functions and variables in streak?

I want to write a simple function for slope (y3-y2/y2-y1) and use them for 9 entries, the rule becomes quite long in streak. Is there an option to create functions and variables in streak?