Linked Questions

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 ...
Martin Ender's user avatar
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 ...
Sp3000's user avatar
  • 61.7k
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 ...
Level River St's user avatar
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 ...
Martin Ender's user avatar
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, ...
tsh's user avatar
  • 34k
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 ...
apsillers's user avatar
  • 3,702
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 ...
Esolanging Fruit's user avatar
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 ...
Dingus's user avatar
  • 10.9k
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 ...
AquaGeneral's user avatar
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 ...
l4m2's user avatar
  • 20.5k