[lazarus] classesh.inc change required

Kevin Berry kevinbe71 at yahoo.com
Sat Dec 25 22:39:28 EST 1999


I hate to point out the obvious, but...
(see my point below - in reply to this)

--- Florian Klaempfl <Florian.Klaempfl at gmx.de> wrote:
[...snip...]
> type
>    tf = function : integer;
> 
> function f : integer;
> procedure p(i : integer);
> procedure p(f : tf);
> 
> In Delphi mode you would write:
> 
> p(f);
> 
> but what should the compiler do? Call f and using
> the first version p or
> using the second one and passing the address of f?
> 
> In FPC mode it's clear:
> p(f);
> means calling f and using the integer version of p
> while 
> p(@f);
> calls the second one
> 

in Delphi, to clarify your call you simply do the
following:
  p(integer(f));
      it will call procedure "procedure p(i:
integer);"

if you do
  p(f) 
       it will call procedure "procedure p(f : tf);"

You have the best type-checking if you don't convert
to a pointer using @.  Unless of course you've
proposed changing the normal behaviour of the @
operator so some kind of type-checking is done with
function and procedure types??

BTW, I now have Linux up and running on my system and
I can dial into the 'net too so I will be doing some
Lazarus development work soon...

Kevin.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com






More information about the Lazarus mailing list