On 20.10.2010 15:33, Jonas Maebe wrote:
On 20 Oct 2010, at 15:12, Sergei Gorelkin wrote:
Jonas Maebe пишет:
Prohibiting it breaks the compilation of dom_html.pp:
dom_html.pp(66,14) Error: Duplicate identifier "ClassName"
If dom_html is the only problem, I think it can be fixed (by renaming
ClassName). The w3.org specs
has many property names which clash with Pascal reserved words (type, label,
etc. That 'ClassName'
was intended to be 'Class'.), so it's anyway impossible to follow the specs
closely.
Other than the ones from my second mail, Lazarus also has problems:
comctrls.pp(930,14) Error: Duplicate identifier "Owner"
comctrls.pp(930,14) Hint: Identifier already defined in unit CLASSES at line 497
(and probably more, since the compilation doesn't get further).
I guess it's more realistic to allow it in all modes.
I don't know how others or the devs see that, but in my opinion its a
very confusing possibilty to be able to redeclare e.g. "ClassName" (I
shivered heavily when I read that). Like it's also confusing to have
local variables in methods named like members of that class (which is
forbidden in objfpc as well as you all might know).
All these cases should be fixed (although that might break further
code), but its for some greater good (less confusion for new users of
such a class). Until the release after 2.4.2 all code will be fixed
hopefully (what about adding a warning to 2.4.2 for such cases?).
Regards,
Sven
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel