On 17/07/14 12:48, Maciej Izak wrote:
> Jonas Maebe wrote:
>     type
>        NSArrayEnumeratorBlock = procedure (obj: id; idx: NSUInteger; var
>    stop: boolean) is block;



What you think about more oxygene compatible syntax for blocks? :

***
type
   ClickEventDelegate = block (obj: id; idx: NSUInteger; var stop: boolean);
***

  IMHO more readable :)

http://www.elementswiki.com/en/Blocks

As mentioned in a previous mail, I'll go with the Delphi-derived syntax ("reference to procedure (obj: id; idx: NSUInteger; var stop: boolean) is block; cdecl;").

The advantage of "... is block" over "block ..." would have been that it was consistent with the existing way to declare procedure variables for nested procvars ("... is nested"). I also don't think we have any syntactical elements taken from Oxygene yet, so let's not start making the language more complicated by mixing in things from even more sources in case one of the existing influences already has a syntax for it.


Jonas

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to