Generalized Stalk Functor Let $X$ be a locally ringed space. If $X$ has a generic point, then $\text{colimit}_{U \text{ dense in } X} \mathcal{O}_X (U)$ is the stalk of $X$ at $U$. What is this in general? That is, if $X$ does not have a generic point, then what is this? Is this the product of the stalks of the irreducible components? Also, could I have a reference for this?
Edit: maybe it would be fair to call it the ring of rational functions.
 A: As I said in the comment, the colimit is not the product of all stalks. (In fact, it does not work if $X$ has a generic point). Here are some examples of this colimits :


*

*Let $X=\mathbb{R}$ with its euclidean topology and $\mathcal{O}_X=\underline{\mathbb Z}$ be the constant sheaf. Then $\underset{U \text{ dense in } X}{\operatorname{colim}}\mathcal{O}_X(U)$ is the set of continuous function with value in $\mathbb{Z}$ which are only define on a dense open subset. This isn't the same thing as the set of all totally defined but not necessarily continuous functions $\mathbb{R\to Z}$.

*Now the previous example is not a locally ringed space (the colimit indeed makes sense for any space and any sheaf, not necessarily a locally ringed space and its structure sheaf). But if you prefer this case, consider again $X=\mathbb{R}$ with its euclidean topology and $\mathcal{O}_X=\mathcal{C}^0$ the sheaf of continuous function. Then $\underset{U \text{ dense in } X}{\operatorname{colim}}\mathcal{O}_X(U)$ is the set of continuous function defined on an dense open subset. Again this is different from the set of all not necessarily continuous function $\mathbb{R\to Z}$.

*Let $X$ be any irreducible space (for example a point) and $\mathcal{O}_X=\underline{R}$ be a constant sheaf with value in some ring $R$. Then for any $U$, $\mathcal{O}_X(U)=R$. It follows that $\underset{U \text{ dense in } X}{\operatorname{colim}}\mathcal{O}_X(U)=R$. In particular, any ring can happen as this colimit (if one require that $X$ is a locally ringed space, then indeed $R$ must be local). Of course, this is different from the product of all stalks if $X$ has more than one point.
