On Wednesday, 30 August 2017 at 04:48:11 UTC, Arun Chandrasekaran wrote:
On Tuesday, 29 August 2017 at 12:45:50 UTC, Jean-Louis Leroy wrote:
On Tuesday, 29 August 2017 at 12:09:01 UTC, Mark wrote:
Nice. This does seem superior to the visitor pattern.

Here is another example - AST traversal: https://github.com/jll63/openmethods.d/blob/master/examples/acceptnovisitors/source/app.d

Thanks for this library. Just a suggestion. Would it possible to use `@openmethod` instead of `@method`?

Ah, I think it's a little late for that. A while ago I asked if anyone had suggestions regarding that sort of things...But now that the article has been published I think it would be a very bad idea to break all the exmaples in it.

What was your rationale for `openmethod` instead of just `method`?

I will push a commit tonight that will make this work:

import openmethods : virtual, openmethod = method, next, registerMethods, updateMethods;

  // ...

  @openmethod // implement 'kick' for dogs
  string _kick(Dog x) // note the underscore
  {
    return "bark";
  }

  • Open Methods: From C++ to D Mike Parker via Digitalmars-d-announce
    • Re: Open Methods: From... rikki cattermole via Digitalmars-d-announce
    • Re: Open Methods: From... Mark via Digitalmars-d-announce
      • Re: Open Methods: ... Jean-Louis Leroy via Digitalmars-d-announce
        • Re: Open Metho... Arun Chandrasekaran via Digitalmars-d-announce
          • Re: Open M... Jean-Louis Leroy via Digitalmars-d-announce
            • Re: O... Arun Chandrasekaran via Digitalmars-d-announce
              • R... Jean-Louis Leroy via Digitalmars-d-announce
                • ... rikki cattermole via Digitalmars-d-announce
                • ... Jean-Louis Leroy via Digitalmars-d-announce
                • ... jmh530 via Digitalmars-d-announce
                • ... Jean-Louis Leroy via Digitalmars-d-announce
                • ... jmh530 via Digitalmars-d-announce
                • ... Jean-Louis Leroy via Digitalmars-d-announce
                • ... Jean-Louis Leroy via Digitalmars-d-announce
                • ... jmh530 via Digitalmars-d-announce

Reply via email to