That syntax,
with the name of result variable looks very nice.operator /(a: tvector4f; b: single)result: tvector4f;
That syntax,
with the name of result variable looks very nice.operator /(a: tvector4f; b: single)result: tvector4f;
I think the syntax for fpc's way of overloading looks weird but I'm able to make it easily maintainable this way:
[pascal]
{$IFDEF FPC}
operator -(a: single; b: tvector4f) result: tvector4f;
{$ELSE}
class operator tvector4f.Subtract(a: single; b: tvector4f): tvector4f;
{$ENDIF}
begin
result := sub(vector4f(a,a,a,a), b);
end;[/pascal]
Peregrinus, expectavi pedes meos in cymbalis
Nullus norvegicorum sole urinat
When we implemented operator overloading years ago, we decided not to diverge the language more than necessary and took the syntax from GNU-Pascal. Unofrtunately, Borland decided that copying C# is more important than Pascal compiler compatibility :evil:
Bookmarks