To the code:
package Test_Function is
type R is record
a: Integer;
end record;
function F return R;
end Test_Function;
...HAC replies:
test_function.ads: 7:20-20: this type is not supported for a function's result; try a procedure with an "out" parameter
Errors found, build failed.
Could this not be supported by the compiler's silently doing precisely this for the user? i.e., isn't every function, in some sense, syntactic sugar for a procedure with an out parameter?
(There may be additional restrictions on a function; e.g., immutability of parameters and global data, but I would imagine that this can likewise be enforced by the compiler while still supporting the change above.)
To the code:
...HAC replies:
Could this not be supported by the compiler's silently doing precisely this for the user? i.e., isn't every function, in some sense, syntactic sugar for a procedure with an
outparameter?(There may be additional restrictions on a function; e.g., immutability of parameters and global data, but I would imagine that this can likewise be enforced by the compiler while still supporting the change above.)