<p>Am 28.04.2017 09:23 schrieb "Ryan Joseph" <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>>:<br>
><br>
><br>
> > On Apr 28, 2017, at 1:06 PM, Sven Barth via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
> ><br>
> > No, I mean<br>
> ><br>
> > rec := (x + y) * 2;<br>
> ><br>
> > The compiler has to differentiate these two.<br>
><br>
> I see. It’s the parenthesis that are problematic. I guess the solution would be curly brackets:<br>
><br>
> rec := {x: 1; y: 2; z: 1}</p>
<p>Curly brackets are comments!</p>
<p>> or some magic function like writeln:<br>
><br>
> rec := TMyRec(x: 1; y: 2; z: 1)</p>
<p>That could be a possibility as the compiler could then correctly handle the field names, however it would have an ambiguity with typecasts until the colon.<br>
Though that would be solvable...</p>
<p>> rec := @(x: 1; y: 2; z: 1)</p>
<p>@ would be nonsense as that would denote a pointer.</p>
<p>> etc…<br>
><br>
> Anyway it could be achieved that would be nice to have a built in constructor for records on the language level.<br>
></p>
<p>Well, feel free to develop a patch, maybe it'll be accepted. I have other fish to fry in the meantime.</p>
<p>Regards,<br>
Sven</p>