[Seed7-users] Seed7 - Using References
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
|
From: Zaakari <Za...@pr...> - 2025-10-08 20:58:23
|
Hey Thomas, I know that values can be bassed by reference into functions--and this, along with templates allows a pointe-like function in a downward direction; but is there a way to have functions return references to variables (upward direction)? And is there a way to create references to variables, such that I could have x and y both refer to the same object? One simple use case for this would be to pass a complex object to a function, and have the function return a reference to a nested property within said object. I see there is the 'reference' type in the manual, but I''ve never been able to get it to work; that is, I don't know how to properly use it, or if it is supposed to used for these sort of examples. Zachary |