如何在Free Pascal中使用匿名方法?

mca*_*dre 7 delphi lambda closures freepascal anonymous-methods

我尝试使用Delphi的匿名方法语法:

type
    fun = reference to function(): Integer;
Run Code Online (Sandbox Code Playgroud)

Fpc显示语法错误:

Error: Identifier not found "reference"
Run Code Online (Sandbox Code Playgroud)

什么是免费Pascal相当于Delphi的匿名方法,如果有的话?

Dav*_*nan 6

FreePascal中没有实现匿名方法.这些功能的列表就在这里.

  • @Wouter:好点,但没必要,因为David的帖子会在几天内有一个日期戳. (2认同)