http://d.puremagic.com/issues/show_bug.cgi?id=5140
bearophile_h...@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_h...@eml.cc --- Comment #1 from bearophile_h...@eml.cc 2010-10-31 05:56:56 PDT --- It also allows code like this, this recursive code will keep working even if "fact" gets renamed, it's more DRY: long fact(long n) { if (n <= 1) return 1; else mixin("return n * " ~ __FUNCTION__ ~ "(n - 1);"); } void main() { assert(fact(20) == 2_432_902_008_176_640_000); } But an alias of the current function is more handy for that purpose: long fact(long n) { if (n <= 1) return 1; else return n * __function(n - 1); } void main() { assert(fact(20) == 2_432_902_008_176_640_000); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------