Skip to content
Prev 180934 / 398506 Next

Functions returning functions

On Wed, May 20, 2009 at 7:48 AM, Wacek Kusnierczyk
<Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> wrote:
The last one is due to lazy evaluation.  Try
repeating it with this variation:

   foo2 = function(a, b) {
	  force(a); force(b)
          function(c) if (c) a else b
   }

which forces a and b to be evaluated right away.