[fpc-pascal] Record operator for assignment

Ryan Joseph ryan at thealchemistguild.com
Thu May 4 11:35:43 CEST 2017


> On May 4, 2017, at 4:27 PM, Marco van de Voort <marcov at stack.nl> wrote:
> 
> Scripting languages often already by default initialize a datatructure, and
> then such language constructs only performs additional initialization.
> 
> Pascal and similar lowlevel languages don't by default initialize them, and then whole initialization is
> more logical.

It’s optional and basically just a default constructor which takes all fields as it’s arguments. You don’t need to call it if you don’t want. Swift is compiled afaik but it does way more behind the scenes than I’d like Pascal to do and does behave like a scripting language in many ways (inferred types for example). That being said Pascal records should still have a default constructor since this is a pattern repeated extremely frequently.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list