BTW, I'm not saying D can't do anything like this enum Dir { Left, Right, Both } string strip(Dir dir = Dir.Both)(string s) but one has to call it like strip!(Dir.Left)(s); (or if using strings, strip!"Left"(s)) Possibly, to make it easier the compiler and localize the enum if one is used: strip!Left(s); // compiler changes to strip!(Dir.Left)(s)