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
next sibling parent "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
prev sibling next sibling parent "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
prev sibling next 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
prev sibling parent Brad Anderson <eco gnuk.net> writes:
--bcaec54b48d0df7a1404b8b532ad
Content-Type: text/plain; charset=ISO-8859-1

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 --bcaec54b48d0df7a1404b8b532ad Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, Feb 11, 2012 at 1:36 AM, Vladimir Panteleev <span dir=3D"ltr">&lt;<= a href=3D"mailto:vladimir thecybershadow.net">vladimir thecybershadow.net</= a>&gt;</span> wrote:<br><div class=3D"gmail_quote"><blockquote class=3D"gma= il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef= t:1ex"> <div class=3D"HOEnZb"><div class=3D"h5">On Saturday, 11 February 2012 at 08= :34:33 UTC, Brad Anderson wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> On Saturday, 11 February 2012 at 08:20:37 UTC, Nathan M. Swan wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> I&#39;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.<br> <br> Any suggestions?<br> <br> Here&#39;s the website:<br> <a href=3D"https://github.com/carlor/cached" target=3D"_blank">https://gith= ub.com/carlor/<u></u>cached</a><br> </blockquote> <br> The more specialized term for this is memoization. =A0It&#39;d be useful to= have in the standard library, in my opinion.<br> </blockquote> <br> </div></div><a href=3D"http://dlang.org/phobos/std_functional.html#memoize"= target=3D"_blank">http://dlang.org/phobos/std_<u></u>functional.html#memoi= ze</a><br> </blockquote></div><br><div>Oh, nice.</div><div><br></div><div>Regards,</di= v><div>Brad Anderson</div> --bcaec54b48d0df7a1404b8b532ad--
Feb 11 2012