[fpc-pascal] Re: Case Sensitivity / Multiple Names
Richard Ward
roward at mac.com
Sun Apr 5 21:56:23 CEST 2009
Francisco Reyes wrote:
> I was refering to not seeing a note that one can not have a unit
> name be the same as a function name. I was never refering to case
> sensitivity. Sorry for not been more clear.
---
Ahh, OK. Yes, I've run into that problem myself. The one I
remember was where I was using the MacOSAll unit which defined a
random function which then hid the FPC version of random with the same
name declared in the system unit. The only reason I figured it out
was that I tried passing a parameter which didn't work and someone
pointed out to me what happened. I was told that you could use both
versions and the FPC version could be accessed by calling
system.random. That is, you can use the unit name as a dot notation
prefix (like a record or method) to access the specific one you want.
In addition, I am thinking it would be a nice feature for an IDE to
color code the FPC RTL routines to give one a clue if you are trying
to redefine a system function. There are reasons for allowing
multiple defined names but it can be a bit confusing.
By the way, I've tested the system.random function and three of the
random functions supplied by Apple via MacOSAll, and I have found the
FPC implementation to be the fastest most "accurate" and most flexible
(due to the FPC function overloading.) - ROW
More information about the fpc-pascal
mailing list