I'm wondering how to do the following:
expr = L + R; foo[L_, R_] := expr; foo[1, 2] (* L + R *)
and have it substitute the function variables into the expression. I realize that I could create dummy variables and do it like
foo[l_, r_] := expr /. L->l /. R->r
but my actual expression has a lot of free variables, and so I would like to know if there is a simpler way.