swift language grammar in general, and specific question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

swift language grammar in general, and specific question

mobi
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

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/c401c963-37c3-49fa-abfc-859c7b70c2f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: swift language grammar in general, and specific question

Ivo Vacek
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 [hidden email] napísal(-a):
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

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/aeb604da-d531-4103-8e0c-ff41dc9483e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.