[fpc-pascal] Uniform initialization?

leledumbo leledumbo_cool at yahoo.co.id
Sun Nov 11 19:29:50 CET 2018


> But *if* I had to decide I would pick #1, cause then there wouldn't be 
> the chance to break existing code if a user decides to add a constructor 
> to their record and some other code relies on there not being a 
> constructor. Also due to the syntax 
> TYPENAME(FIELDNAME:VALUE[;FIELDNAME:VALUE[;…]]) it's in principle 
> possible to have the parser distinguish whether it's a typecast or a 
> default constructor. 

I would pick #1, too, seems more natural to me. There's no ambiguity as well
thanks to : in the syntax. I do wonder how often this would be used, though.
Despite being idiomatic in many languages, it doesn't really save much
typing that traditional way (if that's the main purpose).



--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/



More information about the fpc-pascal mailing list