I'm currently working on formalizing the theory of partial recursive functions, and something seems peculiar about the standard definition. The definition of the primitive recursion clause of $\mu$-recursive functions reads as follows (according to Wikipedia):
Given the $k$-ary function $g({\bf x})$ and $k+2$-ary function $h(y,z,{\bf x})$: \begin{align} \rho(g, h) &\stackrel{\mathrm{def}}{=} f \quad\text{where}\\ f(0,{\bf x}) &= g({\bf x}) \\ f(y+1,{\bf x}) &= h(y,f(y,{\bf x}),{\bf x}). \end{align}
I assume that this definition uses eager evaluation, which is to say that $h(y,f(y,{\bf x}),{\bf x})$ is defined only when $f(y,{\bf x})$ is, even if when we evaluate $h$ it turns out to be a projection or otherwise ignores this argument.
Now this evaluation order means that if $f(y,{\bf x})=\bot$ then $f(y+1,{\bf x})=\bot$. But now how can I define a conditional operator like so:
$$\mathrm{ifz}(g,h)(x)\simeq g(x)\quad\mbox{if }x=0$$ $$\mathrm{ifz}(g,h)(x)\simeq h(x)\quad\mbox{if }x\ne 0$$
where $a\simeq b$ means that both sides are undefined, or defined and equal? Without worrying about definedness, $\mathrm{ifz}$ is a trivial application of primitive recursion, but the naive definition will have $\mathrm{ifz}(\bot,0)(1)=\bot$ since it first tries to evaluate the zero branch. Since obviously Turing machines can define an $\mathrm{ifz}$ operator, either my definition is wrong or there is a more clever way to construct it.
Related (but also unanswered): Eager vs. lazy interpretation of recursive functions