Elogent's answer is excellent. There is another reason that for lists, it doesn't make sense to be functions:
Literal lists already have a different, very important role, so they also cannot be considered functions in the way vectors are.
Let's start with a vector containing two functions: partial and + , and the number - 5 . We can consider a vector as a function, as you know, to return a value indexed by its argument:
user=> ([partial + 5] 2) 5
So far so good. Suppose we want to use a list (partial + 5) instead of a vector, as you said, to return the value 5 . Will an error message appear? No! But we will not get 5 as a result:
user=> ((partial + 5) 2) 7
What happened? (partial + 5) returns a function - a function that adds 5 to a single argument - and then this function was applied to argument 2 .
When a list is evaluated, its first element is evaluated and should return a function. If the first item is a character, it is evaluated, and then a function in which its value is applied to arguments that are other items in the list. If the first argument of a list is itself a list, then it is evaluated as if it were at the top level. The entire expression in this internal list should return a function that will then be applied to other elements of the external list.
Since the internal list, in which the first element of the list that has already been evaluated, already has this role, it also cannot reproduce the role played by the first elements of the vector.
source share