There is a very narrow semantic difference between the two, and I wonder why both options exist. Are they in any other way functional, or maybe it's just a pseudonym of another?
What you're talking about is called closure closure syntax. It is syntactic sugar to facilitate the operation of shutters.
There are many other kinds of syntactic sugars that relate to closure, which I describe in my answer here .
, Swift Language guide, , .
. , .
,
myQueue.async(execute: { foo() })
myQueue.async { foo() }
, , . , , DispatchQueue.async, , .
DispatchQueue.async
.
, , :
myQueue.async(execute: foo)
Source: https://habr.com/ru/post/1674608/More articles:Failed to get SSH fingerprint. Make sure Mac is accessible and remote login is enabled - xamarinhow to programmatically open a menu in python tkinter? - pythonGit repo, where each submodule is a branch of the same repo. How to avoid double / triple ... download using Git clone --recursive? - gitВсплывающее меню Python3 Tkinter не закрывается автоматически при нажатии в другом месте - pythonDynamic number of columns, all centered, on the left side - cssDuplicate column name when updating SQLite for a new column - androidSelect () from LINQ in swift 3.0? - linqIs padding in `col` in Bootstrap 4 Grid System OK? - cssZoomable Treemap in Bokeh - treemapTypescript recursive type with index - recursionAll Articles