function results in `with' statements
Currently GPC allows function results in `with' statements, as in: program foo; type a = record b, c: Integer end; function f: a; begin f := a[b: 2; c: 3] end; begin with f do WriteLn (b, c); end. However, GPC currently also allows assignments to the components, such as: with f do b := 2 which is quite clearly wrong. Probably for this reasone, EP forbids function results in `with' statements at all (6.9.3.10: withÂelement = variableÂaccess | constantÂaccess.). I don't know about other dialects (BP has no records as result types, so the issue doesn't arise. What about Delphi etc.?). At the moment, I'd tend to follow EP here and forbid them at all. Or does anyone think it's really necessary to have them? (Which would probably imply more work to make the fields read-only.) Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html NEW! GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8
participants (5)
-
Adriaan van Os -
Frank Heckenbach -
Josef Urban -
Maurice Lombardi -
Prof A Olowofoyeku (The African Chief)