Re: [fpc-pascal] method order

2010-05-01 Thread spir ☣
On Fri, 30 Apr 2010 19:17:51 +0200
Mattias Gaertner  wrote:


> Maybe you don't know 'forward'?

Thank you!

Denis


vit esse estrany ☣

spir.wikidot.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] method order

2010-04-30 Thread Mattias Gaertner
On Fri, 30 Apr 2010 18:34:43 +0200
spir ☣  wrote:

> (Note: I use "method" for "either procedure or function"; if there is a 
> proper term, please tell me --I don't know any.)

Normally:

method = function/procedure of a class with an instance 'Self'

class method = method where Self is the class type, not an instance


> A short question:
> Why must a called method be defined before the caller, since it will be 
> called only at runtime?
> Also: what is the trick then (on the implementation side), to allow recursion?

Maybe you don't know 'forward'?

procedure DoSomething; forward;

procedure Doing;
begin
  if ... then DoSomething;
end;

procedure DoSomething;
begin
  if ... then Doing;
end;


Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] method order

2010-04-30 Thread spir ☣
(Note: I use "method" for "either procedure or function"; if there is a proper 
term, please tell me --I don't know any.)

Hello,

A short question:
Why must a called method be defined before the caller, since it will be called 
only at runtime?
Also: what is the trick then (on the implementation side), to allow recursion?

Denis


vit esse estrany ☣

spir.wikidot.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal