I'm trying to understand the definition of derivative as a slope.
The definition is as follows:
Let $a \in \mathbb{R}$. Let $f$ be a function defined, at least, on an interval centered at $a$. The derivative of $f$ at $a$ is the number:
$$f'(a) = \lim\limits_{x \to a} \frac{f(x) - f(a)}{x -a}$$
When I learned about limits, I learned that they apply to functions. How come it also applies to a slope?
I was thinking that maybe a slope can be interpreted as a function with four inputs, like this:
$$m(x_1, x_2, y_1, y_2) = \frac{y_2 - y_1}{x_2 - x_1}$$
Is that a valid interpretation?