The only criteria whether your code is functional or not is whether it follows the substitution model, that any of its constituent expressions can be substituted for the result of evaluating those expressions without changing the meaning of your program.