Feature request: Path append operators for strings

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Jul 5 09:17:36 PDT 2013


On Fri, Jul 05, 2013 at 05:04:46PM +0200, Paulo Pinto wrote:
> Am 05.07.2013 16:59, schrieb TommiT:
> >On Tuesday, 2 July 2013 at 23:28:41 UTC, monarch_dodra wrote:
> >>On Tuesday, 2 July 2013 at 21:48:54 UTC, Walter Bright wrote:
> >>>On 7/2/2013 1:47 PM, TommiT wrote:
> >>>>Division operator for strings doesn't make any sense,
> >>>
> >>>That's why overloading / to do something completely unrelated to
> >>>division is anti-ethical to writing understandable code.
> >>
> >>s/division/"The common agreed upon semantic"/
> >>
> >>>The classic example of this is the overloading of << and >> for
> >>>stream operations in C++.
> >>
> >>Or overloading ~ to mean "concat" ?
> >
> >It's rather C++'s std::string which overloads the meaning of + to mean
> >"concatenation". I wonder if some other programming language has
> >assigned some other symbol (than ~) to mean "concatenation". I guess
> >math uses || for it.
> 
> Visual Basic uses &
> Perl and PHP use  .
> Ocaml uses        ^
> 
> Just from the top of my mind, surely there are other examples.
[...]

Python uses +.

Arguably, C uses blank (two string literals side-by-side are
automatically concatenated), but that's a hack, and an incomplete one at
that. :-P


T

-- 
Lawyer: (n.) An innocence-vending machine, the effectiveness of which depends on how much money is inserted.


More information about the Digitalmars-d mailing list