码迷,mamicode.com
首页 > 其他好文 > 详细

Block Functionality

时间:2018-06-05 19:56:30      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:ons   arch   bsp   ali   closure   lex   capture   cal   stack   

Block Functionality

A block is an anonymous inline collection of code that:

  • Has a typed argument list just like a function

  • Has an inferred or declared return type

  • Can capture state from the lexical scope within which it is defined

  • Can optionally modify the state of the lexical scope

  • Can share the potential for modification with other blocks defined within the same lexical scope

  • Can continue to share and modify state defined within the lexical scope (the stack frame) after the lexical scope (the stack frame) has been destroyed

 

Swift‘s anonymous functions are called Closures.

 

https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Blocks/Articles/bxOverview.html#//apple_ref/doc/uid/TP40007502-CH3-SW1

Block Functionality

标签:ons   arch   bsp   ali   closure   lex   capture   cal   stack   

原文地址:https://www.cnblogs.com/feng9exe/p/9141328.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!