Linked Questions

127 votes
118 answers

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

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.9k
7 votes
3 answers

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

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

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
  • 34.9k
9 votes
3 answers

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,742
7 votes
2 answers

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

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
  • 11.2k
1 vote
1 answer

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

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
  • 24.5k