When I played with symbol resolution, I constructed a "beautiful" method declaration:
When I played with symbol resolution, I constructed a "beautiful" method declaration:
type
comp = class
private
function comp(comp: comp): comp;
end;
function comp.comp(comp: comp): comp;
begin
comp := comp;
end;
Wow, It compiles! :D
type
comp = class
private
function comp(comp: comp): comp;
end;
function comp.comp(comp: comp): comp;
begin
comp := comp;
end;
Wow, It compiles! :D
Panagiotis Drivilas yes. It does make sense only in symbol resolution.
ReplyDeleteSo when the symbol comp is referenced from inside the method, is it referring to the result or the parameter? If it's the result, how would one reference the parameter, or is it impossible because of the method name?
ReplyDeleteAnthony Frazier It refers to the parameter within the scope. however, if you use comp := comp.comp(comp); the third comp symbol refers to the method, of course.
ReplyDelete