A server side example:

cachedValue = cacheEngine.get( cacheKey, 
functionToReturnCachedValueWhenNotInCache );


Rather than:

if ( not cacheEngine.exists( cacheKey ) ){

 cacheEngine.set( cacheKey, functionToReturnCachedValueWhenNotInCache( 
cacheKey ) );

}

cachedValue = cacheEngine.get( cacheKey ); 


Just another pattern to help make more terse code I guess.  


On Sunday, 20 May 2012 21:24:43 UTC+1, Travis wrote:
>
> What practical purposes would one even need closures for in a server- 
> side environment? Just wondering.

-- 
online documentation: http://openbd.org/manual/
 http://groups.google.com/group/openbd?hl=en

Reply via email to