Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-10

[OT] Is "reference to procedure" implemented in trunk?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joost van der Sluis
to silvioprog
silvioprog wrote
Can I use something like this using FPC from trunk?: http://www.drbob42.com/examines/examinA5.htm

Why don't you just try it yourself?

And there are quite some techniques in that article. which one do you mean? Maybe if you take some more time to formulate your real question?

The article mentions anonymous functions, which are not supported, but are also useless. People asking for anonymous functions almost always mean that they want closures. In Delphi the way to use a closure is through an anonymous function.

My guess is that the answer to your question is no, but for a real answer we need more information.

Joost.

Reply by email

silvioprog
to Joost van der Sluis
Joost van der Sluis wrote 9 lines
On 10/20/2014 08:35 PM, silvioprog wrote: > Can I use something like this using FPC from trunk?: > > http://www.drbob42.com/examines/examinA5.htm > Why don't you just try it yourself?

Unfortunatelly in the moment I have no a FPC from trunk, I will install it as soon as possible.

And there are quite some techniques in that article. which one do you mean? Maybe if you take some more time to formulate your real question?

The doubt shown in the title: "Is "reference to procedure" implemented in trunk?". Eg:

TProc = *reference to* procedure(x: Integer);
procedure call(const proc: TProc);
begin
  proc(42);
end;
var
  proc: TProc;
begin
  proc := procedure(a: Integer)
  begin
    Button1.Caption := IntToStr(a)
  end;
  call(proc)
end;

The article mentions anonymous functions, which are not supported ...

Thanks, it answers my question! ;)

For a moment I thought something like this was implemented, then I would test it.

... but are also useless.

OK, thanks again!

Silvio Clécio My public projects - github.com/silvioprog

Reply by email