[Newbies] Efficient date parsing

Ramon Leon ramon.leon at allresnet.com
Wed Apr 2 20:57:03 UTC 2008


> 
> Implement a simple cache:
> 
>    ^dateCache at: dateString ifAbsent:
>       [dateCache at: dateString put: (Date from: dateString)].
> 
> something like that.
>
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095 <merlyn at stonehenge.com> 

Or more idiomatic...

^dateCache at: dateString ifAbsentPut: [Date from: dateString].

Ramon Leon
http://onsmalltalk.com



More information about the Beginners mailing list