Module:FnUtil: Revision history

From TwogPedia

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

19 August 2022

  • curprev 21:2621:26, 19 August 2022Couchor talk contribs 1,355 bytes +1,355 Created page with "local FnUtil = {} -- Creates a memoized copy of a 0 or 1 param function. function FnUtil.memoize(f) local called = {} local results = {} local nilCalled = false local nilResult return function(x) if x == nil then if not nilCalled then nilCalled = true nilResult = f(x) end return nilResult else if not called[x] then called[x] = true results[x] = f(x) end return results[x] end end end --[[ Memoized variant of the Y combinator..."