Standard question: `New' with variant records
Another standard question. Is the following valid: program Foo; type t = record case Integer of 1: () end; var v: ^t; begin New (v, 2) end. Some of GPC's test programs (not written by me) do something like this, but I doubt whether that's ok. As usual, the language of the standard (6.7.5.3 in EP) is somewhat confusing, so I'm better asking to be sure ... Another thing: The standard allows to set variant tags or schema discriminants in `New', but not both together. Is this an artificial restriction, or would there be some deeper problem with code like this: program Foo; type t (n: Integer) = record case Integer of 1: () end; var v: ^t; begin New (v, 42 { discriminant }, 1 { variant tag }) end. 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 GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
participants (2)
-
Emil Jerabek -
Frank Heckenbach