Skip to main content
3 of 6
replaced http://meta.codegolf.stackexchange.com/ with https://codegolf.meta.stackexchange.com/

On scoring builtin functions

Suppose there's a challenge which can be solved completely by a builtin function, and functions are allowed. Note that as of writing the standard loophole for builtins is heavily disputed, but let's just assume that the poster explicitly allowed builtins since that's not the point of this question.

Which of the following submissions would be valid? To give a more concrete example, let's say the task was adding a list of numbers.

                   0 bytes, since the user can use the function already
sum                3 bytes, an expression which evaluations to a function
s=sum              5 bytes, aliasing the builtin
lambda L:sum(L)    15 bytes, an explicit unnamed function

Similarly, if the task was to multiply two numbers, would the following be valid? Or rather, is it possible that the following is only valid in languages which treat operators in a certain way?

*                  1 byte, multiplication operator

(For context, this question was inspired by the Calculate Standard Deviation question)

Sp3000
  • 61.9k
  • 25
  • 30