[Proposal] Memorization for running function only once


(Muse M) #1

Hi,

I propose* "*memorization" or "memo" keyword for a function that allows to
run only once through out the lifecycle in Swift 3. Repeatedly execute the
function will only return the same result without having to rerun the
function everytime.

memo func hello(fname: String, lname: String) {
   return fname.lname
}

This is useful for certain case for web application and value that don't
need change once executed.