In python you have a function decorators. Is it possible to do something similar in D? something like:
@memoize("expensiveCalc")
int expensiveCalc(string foo){
///bar
}
Yes, it is possible. However, in D it is called an "user defined attribute" (UDA). It has been introduced in D relatively recently, and since then people use it more and more to annotate their functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With