On 05/08/2018 05:05 AM, Cym13 wrote:

I wouldn't say it's an abuse, the dot means exactly the same thing as everywhere else in the language.

No, it really doesn't mean the same thing at all. Not when you look away from the unimportant implementation details and towards the big picture:

Normally, saying "x.y" denotes composition and membership: It means "y, which is a member of x". Saying "x.y" does NOT normally denote "The boundary between word 'x' and word 'y' in an english-grammared phrase".

But with things like "should.not.be", it's very much NOT a composition/membership relationship: A "be" is not really a member/property/component/etc of a "not", except in the sense that that's how the english-like DSL is internally implemented. A "should" is not really something that is composed of a "not", except in the sense that that's how the english-like DSL is internally implemented. (IF it even is implemented that way at all. I didn't look, so for all I know it might be opDispatch.)

I'm not saying that "should.not.be" OR "~" are abuses, I'm just saying whether or not they are, they're definitely both in the same category: Either they're both abuses or neither one is, because they both do the same thing: utilize use existing syntax for something other than the syntax's usual semantic meaning.

Formal "operator overloading" isn't the only way to alter (or arguably abuse) a language's normal semantics.
  • unit-threaded v0.7.4... Atila Neves via Digitalmars-d-announce
    • Re: unit-thread... Johannes Loher via Digitalmars-d-announce
      • Re: unit-th... Dechcaudron via Digitalmars-d-announce
        • Re: uni... Johannes Loher via Digitalmars-d-announce
          • Re:... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
            • ... Cym13 via Digitalmars-d-announce
              • ... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
                • ... Cym13 via Digitalmars-d-announce
                • ... bauss via Digitalmars-d-announce
            • ... Jacob Carlborg via Digitalmars-d-announce
          • Re:... Dechcaudron via Digitalmars-d-announce
      • Re: unit-th... bauss via Digitalmars-d-announce

Reply via email to