How to substitue local variables into expression with free variables?

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.

-
Check out Evaluate. –  chuy Jan 21 at 17:45
foo[L_,R_]=expr; The := is delayed evaluation which is usually correct but not in this precise case. –  Ymareth Jan 21 at 18:30
Use = instead of :=. It's not necessary to Evaluate IMO because it would be completely equivalent to just using =. I'd consider this question a duplicate of What is the difference between Set and SetDelayed?. –  Szabolcs Jan 21 at 19:30

As noted in the comments, use Set (=) instead of SetDelayed (:=) while making sure that L and R have no value assigned:
expr = L+R

I went ahead and changed this, since it was community wiki. I think Evaluate would be completely equivalent to just using Set here. Hope you don't mind, please check the edit. –  Szabolcs Jan 21 at 19:32