Let $F$ be a sheaf of $k$-algebras on a topological space $X$. So by definition, $F$ is a contravariant functor from the category of open sets of $X$ to the category of $k$-algebras, satisfying a certain patching condition and a uniqueness condition.
If $U$ is open in $X$, then we can define a restricted sheaf $F_{|U}$ on $U$, where for $V \subseteq U$ open, we set $F_{|U}(V) = F(V)$.
Suppose now that for each $U$ open, $F(U)$ is actually a $k$-subalgebra of functions $U \rightarrow k$. Then for any subset $W$ of $X$, not necessarily open, we may define a restriction sheaf $F_{|W}$ on $W$, where for $U$ open in $W$, we say that a function $f:U \rightarrow k$ lies in $F_{|W}(U)$ if and only if there exist open sets $U_i$ of $X$, and functions $f_i \in F(U_i)$, such that $U = W \cap (\bigcup\limits_i U_i)$, and $f_{|W \cap U_i} = f_{i|W \cap U_i}$ for each $i$.
My question is, suppose we do not assume that the objects $F(U)$ (for $U$ open in $X$) are actually sets of functions from $U$ to $k$. Is there some way to make sense out of a restriction sheaf $F_{|W}$ for any subset $W$ of $X$? Or in general, will this only make sense for $W$ open in $X$?