lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Doesn't memoization become very difficult, if at all possible, if you don't have pure functions? Memoization works because you can assume that if a function is called with the same arguments then it will give the same results every time so we can remember the args -> result mapping. When you have side-effects and mutable data it becomes very difficult. Which I think makes it not very usable for Lua.

Robert

----- Original Message -----
> From: "Paul Merrell" <marbux@gmail.com>
> To: "Lua mailing list" <lua-l@lists.lua.org>
> Sent: Tuesday, 29 October, 2013 11:03:36 PM
> Subject: Re: PiL3: typos
> 
> Wikipedia has a fairly lengthy article on memoization.
> <https://en.wikipedia.org/wiki/Memoize>.
> 
> Best regards,
> 
> Paul
> 
> --
> [Notice not included in the above original message:  The U.S. National
> Security Agency neither confirms nor denies that it intercepted this
> message.]
> 
>