Commits

Taylor Venable committed 6af3492

Add misc.parameter()

Comments (0)

Files changed (1)

    end
 end
 
+function misc.parameter(init)
+   local x = init
+   return function (new)
+      if new == nil then
+         return x
+      else
+         local y = x
+         x = new
+         return y
+      end
+   end
+end
+
 return misc