> On Mar 30, 2019, at 12:56 AM, Anthony Walter <[email protected]> wrote:
>
> So the default property indexer returns references and not values. If you
> want values specifically you can use the Item property indexer.
>
> This way we can either access fields directly on the items withing the array
> like so:
>
> A[0].X := SomeValue;
>
Yes, but it’s a pointer so we need to dereference with ^.
A[0]^.X := 1;
That’s the one difference which we can’t resolve now. Basically we would need a
“var” result introduced into the language. C++ has that feature so maybe it’s
not crazy to implement in Pascal.
int& getter() {
return i;
}
function getInt: integer; var;
begin
result := i;
end;
Regards,
Ryan Joseph
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel