swift language grammar in general, and specific question

69 views
Skip to first unread message

mo...@mobiphil.com

unread,
Nov 18, 2014, 11:32:22 AM11/18/14
to swift-l...@googlegroups.com
Hi,

new to the language, but more interested from the language syntax point of view.
found the grammar definition on the website, but have some questions that from the grammar is not clear.
do not have an mac computer, so no Xcode, cannot test certain things. 

here some questions, would more than welcome your answers;

1. according to the grammar, an empty block is not a valid statement, for instance a simple 

var i = 10
{
}

or inside o function

func f()
{
   {

   }
}



2. is there any discussion group about the grammar, parser itself? 

I am interested to write an open source parser/compiler for the language, any hint (technical, legal, participation interest) would be more than wellcome



regards,
mobiphil

Ivo Vacek

unread,
Dec 29, 2014, 8:11:04 AM12/29/14
to swift-l...@googlegroups.com
an "empty block" is in reality an "unused closure"

// Int variable with value 10
var i = 10

// invalid use of closure
{
}

// valid, but unusable :-)

() =

{


}()


Dňa utorok, 18. novembra 2014 17:32:22 UTC+1 mo...@mobiphil.com napísal(-a):
Reply all
Reply to author
Forward
0 new messages