Re: interesting semantic possible?

2013-07-21 Thread bearophile
JS: Say I have a template function where there are variations, it would be nice to be able to specify those variables like strip!Left(s), strip!Right(s), strip(s), etc... instead of ahving to do stripLeft, stripRight, and strip. But the goal isn't just to add an extra ! to type but that it

Re: interesting semantic possible?

2013-07-21 Thread JS
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:

interesting semantic possible?

2013-07-21 Thread JS
Say I have a template function where there are variations, it would be nice to be able to specify those variables like strip!Left(s), strip!Right(s), strip(s), etc... instead of ahving to do stripLeft, stripRight, and strip. But the goal isn't just to add an extra ! to type but that it reduce