[lazarus] classesh.inc change required

Kevin Berry kevinbe71 at yahoo.com
Wed Dec 22 11:51:31 EST 1999


But TMyFunc isn't just a pointer, it is a type that is
a function returning an integer.  Correct me if I'm
wrong here...  I can't verify this with FPC at the
moment.

Even though you are taking the address of the function
(and thus returning a pointer) surely the compiler
doesn't just assign any pointer value to the var of
type TMyFunc.  You'd end up with a rather nasty crash
if it allowed you to assign any address to the
function variable and then called that function.

BTW, I do prefer the Delphi way of not expecting an @
to be prefixed.  The @ prefix reminds me of the way
C++ operates with the & operator.  I like the way ^
and @ are really optional in Delphi's Object Pascal. 
I thought it was quite a clever modification they made
to the language...

Kevin.

--- Marc Weustink <Marc.Weustink at cuperus.nl> wrote:
> Ok... I'm not into the compiler internals, but if
> I'm correct, if you have
> an untyped pointer, it is just a pointer and the
> compiler shouldn't (can't)
> do typechecking anything else then if it is correct
> to asign a plain
> pointer.
> 
> Marc

__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one place.
Yahoo! Shopping: http://shopping.yahoo.com






More information about the Lazarus mailing list