Linked Questions
10 questions linked to/from Do function submissions have to be reusable?
127
votes
116
answers
38k
views
Default for Code Golf: Input/Output methods
It looks like we have a consensus that we want certain defaults for the format which answers are expected in for code-golf. On that poll, the question arose twice, which input/output formats should be ...
24
votes
3
answers
3k
views
Should submissions be allowed to exit with an error?
Suppose we have the following Python code:
f=lambda x:x*2
X
The first line defines a function which doubles a number. Then the second line is reached, is found ...
7
votes
3
answers
357
views
When submitting a function, can global variables be declared outside the function? [duplicate]
1. When submitting a function, can global variables be declared outside the function?
For example, if I have the C code
f(n){int a,b,c=4;dosomething;}
am I ...
16
votes
1
answer
796
views
What are our rules about additional code accompanying function submissions?
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 ...
13
votes
2
answers
284
views
Is function returned by first invoke of a currying function submission required to be reusable?
As per past discussion, function submissions should be reusable. And, currying function may be a valid submission.
Consider a challenge which require 2 inputs x, ...
9
votes
3
answers
250
views
Is it legal to submit a function that must exist as a method on an object?
For a challenge, I recently submitted the JavaScript solution
[].push
To be clear, this isn't x=>[].push. The entry itself ...
7
votes
2
answers
253
views
Definition of a Function in Concatenative Languages
Concatenative languages are languages where juxtaposition of functions represents composition. Programs consist of the primitives in the language combining to form a large function which takes program ...
11
votes
1
answer
255
views
Functions throwing exceptions: an exception to the rules?
I'm seeking greater clarity around whether we currently allow functions to throw exceptions, and if so, under what circumstances. There seem to be contradictory posts on this topic—several highly ...
1
vote
1
answer
93
views
Necessity of Wrapping Solution into Method/Function
I've noticed that sometimes people using exotic languages like Brainfuck don't ever explicitly wrap a solution into a method/function. While sometimes I see solutions in Java and such where they are ...
4
votes
1
answer
57
views
Do function submissions have to recover environment if it consumes whole stdin?
Community agrees that functions should be reusable while if a function take whole stdin (like while(gets()) in C or ...