This is an extension of this meta question.
I've always assumed that function submissions were allowed under the premise that the code would be evaluated once and would in the process either:
- Define a named function which can be used from then on.
- End with an expression which evaluates to an unnamed function, such that if it would be captured in a name could be reused arbitrarily often.
Is that actually what everyone else thinks function submissions should be like? This encompasses several subquestions:
- Do function submissions have to consist of a single definition/expression, or can they be accompanied by additional code which defines helper functions or variables outside the function itself?
- Are function submissions allowed if it's necessary to repeat the entire function definition/expression each time the function should be used? (Or does it have to be possible to store the function in a name once and reuse it from the on.)
- If functions are accompanied by additional code, and it's allowed to require the function definition to be repeated, is it allowed to require the accompanying code to be repeated, too?