www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - cache.d

reply "Nathan M. Swan" <nathanmswan gmail.com> writes:
I've created a utility for creating caches of function calls; I imagine 
it being used for time-consuming functions which are often called with 
the same arguments several times.

Any suggestions?

Here's the website:
https://github.com/carlor/cached
Feb 11 2012
parent reply "Brad Anderson" <eco gnuk.net> writes:
On Saturday, 11 February 2012 at 08:20:37 UTC, Nathan M. Swan 
wrote:
 I've created a utility for creating caches of function calls; I 
 imagine it being used for time-consuming functions which are 
 often called with the same arguments several times.

 Any suggestions?

 Here's the website:
 https://github.com/carlor/cached

The more specialized term for this is memoization. It'd be useful to have in the standard library, in my opinion. Regards, Brad Anderson
Feb 11 2012
next sibling parent reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Saturday, 11 February 2012 at 08:34:33 UTC, Brad Anderson 
wrote:
 On Saturday, 11 February 2012 at 08:20:37 UTC, Nathan M. Swan 
 wrote:
 I've created a utility for creating caches of function calls; 
 I imagine it being used for time-consuming functions which are 
 often called with the same arguments several times.

 Any suggestions?

 Here's the website:
 https://github.com/carlor/cached

The more specialized term for this is memoization. It'd be useful to have in the standard library, in my opinion.

http://dlang.org/phobos/std_functional.html#memoize
Feb 11 2012
parent Brad Anderson <eco gnuk.net> writes:
On Sat, Feb 11, 2012 at 1:36 AM, Vladimir Panteleev <
vladimir thecybershadow.net> wrote:

 On Saturday, 11 February 2012 at 08:34:33 UTC, Brad Anderson wrote:

 On Saturday, 11 February 2012 at 08:20:37 UTC, Nathan M. Swan wrote:

 I've created a utility for creating caches of function calls; I imagine
 it being used for time-consuming functions which are often called with the
 same arguments several times.

 Any suggestions?

 Here's the website:
 https://github.com/carlor/**cached <https://github.com/carlor/cached>

The more specialized term for this is memoization. It'd be useful to have in the standard library, in my opinion.

http://dlang.org/phobos/std_**functional.html#memoize<http://dlang.org/phobos/std_functional.html#memoize>

Oh, nice. Regards, Brad Anderson
Feb 11 2012
prev sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Saturday, February 11, 2012 09:34:32 Brad Anderson wrote:
 On Saturday, 11 February 2012 at 08:20:37 UTC, Nathan M. Swan
 
 wrote:
 I've created a utility for creating caches of function calls; I
 imagine it being used for time-consuming functions which are
 often called with the same arguments several times.
 
 Any suggestions?
 
 Here's the website:
 https://github.com/carlor/cached

The more specialized term for this is memoization. It'd be useful to have in the standard library, in my opinion.

It is. std.functional.memoize. - Jonathan M Davis
Feb 11 2012