> On Dec 27, 2021, at 1:44 AM, bla...@blaise.ru wrote:
> 
> So, in your book, introducing a /new/ operator identifier "doesn't present 
> any new syntax" (and I agree), but semantically allowing the /existing/ 
> directive DEFAULT to appear in the existing list of method directives is 
> somehow "a new syntax". You have some interesting definition of "syntax".

I was mainly just trying to predict what Sven will say because I've proposed so 
many things over the recent years. :) "Default" has never been used outside of 
properties which is why it could be considered "new syntax".

As for the idea of a "call operator" that would require "self" to be passed in 
as the first param (like record management operators) AND "class operator" is 
not allowed in classes right now so this would limit it to records  only. I 
already tried to get Sven to accept class operators on classes (for some 
operators only) and this was rejected.

Given that I would say this would indeed go the way of properties since it's a 
form of aliasing or re-routing:

      property Invoke: T read DoInvoke; default;

However I have already made a patch (nearly finished) for a "default record 
property" which does something similar to this (it's meant for smart pointers 
like how C++ overloads the -> operator) and even though Sven did seem behind 
the idea I don't see he's been willing to follow up on it. Not sure what this 
means for the feature or if it will ever be accepted.

https://gitlab.com/genericptr/free-pascal/-/tree/default_record_property

So if there is now a default method it would confound this idea even further 
and it's already not clear if FPC will accept this kind of thing.

I'm not saying any of this to discourage the idea though since I think it's 
interesting.

Regards,
        Ryan Joseph

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to