Alexander Klenin wroteOn Sat, Oct 9, 2010 at 14:24, Hans-Peter Diettrich
Show quoted text 12 lines
>> break, continue and exit are not keywords. They could be
>> redefined.
>
> I'd appreciate when, at least in mode FPC, these words would become
> keywords. As already mentioned, a redefinition of these procedures can
> only cause trouble. When they occur in legacy code, it would do no harm
> when such modules had to be compiled in an different (Delphi) mode.
Yes, this would be a good change, similar to restrictiions on the duplicate
variable names in the overlapping scopes.
I think, however, that this change has near-zero chance of
getting through fpc core team.
I would vote for this this, too. Maybe nobody asked the fpc core team, so I cross-post this also to fpc-devel list.
I just realized how important the duplicate variable name restriction is when I tried to convert some existing code. Clearly the original author didn't always know which variable gets used.
Juha
Show quoted text 9 lines
One relevant data point: for many years,
I use Delphi for the "Programming 101" university course I teach.
Every year, out of approx. 15 students in the group, 5-6 make the mistake
of naming some component or variable "exit" or "break", and spend
hours or even days trying to find the problem, until they finally give
up and ask me for help.
--
Alexander S. Klenin
