<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Syntax</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>Recent changes to Syntax</description><atom:link href="https://sourceforge.net/p/meson/wiki/Syntax/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 04 Sep 2014 07:56:17 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/meson/wiki/Syntax/feed" rel="self" type="application/rss+xml"/><item><title>Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v12
+++ v13
@@ -1,3 +1,10 @@
+The Meson build system has moved
+==
+
+The new home of Meson's documentation is [here](https://github.com/jpakkane/meson/wiki). The information below is preserved only for posterity. It should be considered out of date.
+
+-------
+
 Syntax and structure of Meson files
 ==

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Thu, 04 Sep 2014 07:56:17 -0000</pubDate><guid>https://sourceforge.net10a013133edff643150ce0c18ece6ab166b746cd</guid></item><item><title>Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v11
+++ v12
@@ -32,6 +32,17 @@
 --

 Strings in Meson are declared with single quotes. 
+
+String formatting
+--
+
+Strings can be built using the string formatting functionality.
+
+    template = 'string: @0@, number: @1@, bool: @2@'
+    res = template.format('text', 1, true)
+    # res now has value 'string: text, number: 1, bool: true'
+
+As can be seen, the formatting works by replacing placeholders of type &lt;tt&gt;@number@&lt;/tt&gt; with the corresponding argument.

 Arrays
 --
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Sat, 27 Jul 2013 17:14:14 -0000</pubDate><guid>https://sourceforge.net0e28d1d67f14b6af95efdac8572c0be9602dcd06</guid></item><item><title>Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v10
+++ v11
@@ -93,7 +93,7 @@
 Comments
 --

-A comment starts with the character &lt;tt&gt;#&lt;/tt&gt; and extends until the end of the line.
+A comment starts with the &lt;tt&gt;#&lt;/tt&gt; character and extends until the end of the line.

     some_function() # This is a comment
     some_other_function()
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Sat, 27 Jul 2013 15:02:48 -0000</pubDate><guid>https://sourceforge.net8c8d9f82034f47b676bda886e18dfadf74ca24fa</guid></item><item><title>Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v9
+++ v10
@@ -1,7 +1,7 @@
 Syntax and structure of Meson files
 ==

-The syntax of Meson's specification language has been kept as simple as possible. It is *strongly typed* so no object is ever converted to another under the covers. Variables have no visible type which makes *dynamically typed* (also known as *duck typed*).
+The syntax of Meson's specification language has been kept as simple as possible. It is *strongly typed* so no object is ever converted to another under the covers. Variables have no visible type which makes Meson *dynamically typed* (also known as *duck typed*).

 The main building blocks of the language are *variables*, *numbers*, *booleans*, *strings*, *arrays*, *function calls*, *method calls*, *if statements* and *includes*.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Sat, 27 Jul 2013 15:01:21 -0000</pubDate><guid>https://sourceforge.net05d0806258591ee7683be5647b237583e00315e0</guid></item><item><title>Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v8
+++ v9
@@ -64,6 +64,8 @@
     var2 = 2
     if var1 == var2 # Evaluates to false
       something_broke()
+    elif var3 == var2
+      something_else_broke()
     else
       everything_ok()
     endif
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Sat, 27 Jul 2013 15:00:49 -0000</pubDate><guid>https://sourceforge.netaec4aba3deb093df945ecffc7fbd3f7d4763e0de</guid></item><item><title>Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v7
+++ v8
@@ -68,6 +68,26 @@
       everything_ok()
     endif

+Logical operations
+--
+
+Meson has the standard range of logical operations.
+
+    if a and b
+      # do something
+    endif
+    if c or d
+      # do something
+    endif
+    if not e
+      # do something
+    endif
+    if not (f or g)
+      # do something
+    endif
+
+Logical operations work only on boolean values. 
+
 Comments
 --

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Sat, 27 Jul 2013 14:30:47 -0000</pubDate><guid>https://sourceforge.net132bb2e8582b36f01abc9fec3aee212e7db899ec</guid></item><item><title>WikiPage Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -5,7 +5,7 @@

 The main building blocks of the language are *variables*, *numbers*, *booleans*, *strings*, *arrays*, *function calls*, *method calls*, *if statements* and *includes*.

-Usually one Meson statement takes just one line. There is no way to have multiple statements on one line as in e.g. *C*. Function and method calls' argument lists can be split over multiple lines. Meson will autodetect this case and do the right thing.
+Usually one Meson statement takes just one line. There is no way to have multiple statements on one line as in e.g. *C*. Function and method calls' argument lists can be split over multiple lines. Meson will autodetect this case and do the right thing. Apart from line ending whitespace has no syntactical meaning.

 Variables
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Sun, 03 Mar 2013 20:01:16 -0000</pubDate><guid>https://sourceforge.netd44cb70807556c6b827453e1f90d541eee09fe57</guid></item><item><title>WikiPage Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -38,7 +38,7 @@

 Arrays are delimited by brackets. An array can contain an arbitrary number of objects of any type.

-    my_array = \[1, 2, 'string', some_obj]
+    my_array = [1, 2, 'string', some_obj]

 Function calls
 --
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Sun, 03 Mar 2013 20:00:15 -0000</pubDate><guid>https://sourceforge.net15fc4455e2b35075dbea1a9ae7fc45258c83c27b</guid></item><item><title>WikiPage Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -13,8 +13,8 @@

 Variables in Meson work just like in other high level programming languages. A variable can contain a value of any type, such as an integer or a string. Variables don't need to be predeclared, you can just assign to them and they appear. Here's how you would assign values to two different variables.

-&lt;tt&gt;var1 = 'hello'
-var2 = 102&lt;/tt&gt;
+    var1 = 'hello'
+    var2 = 102

 Numbers
 --
@@ -26,7 +26,7 @@

 A boolean is either &lt;tt&gt;true&lt;/tt&gt; or &lt;tt&gt;false&lt;/tt&gt;.

-&lt;tt&gt;truth = true&lt;/tt&gt;
+    truth = true

 Strings
 --
@@ -38,22 +38,22 @@

 Arrays are delimited by brackets. An array can contain an arbitrary number of objects of any type.

-&lt;tt&gt;my_array = \[1, 2, 'string', some_obj]&lt;/tt&gt;
+    my_array = \[1, 2, 'string', some_obj]

 Function calls
 --

 Meson provides a set of usable functions. The most common use case is creating build objects.

-&lt;tt&gt;executable('progname', 'prog.c')&lt;/tt&gt;
+    executable('progname', 'prog.c')

 Method calls
 --

 Objects can have methods, which are called with the dot operator. The exact methods it provides depends on the object.

-&lt;tt&gt;myobj = some_function()
-myobj.do_something('now')&lt;/tt&gt;
+    myobj = some_function()
+    myobj.do_something('now')

 If statements
 --
@@ -73,16 +73,16 @@

 A comment starts with the character &lt;tt&gt;#&lt;/tt&gt; and extends until the end of the line.

-&lt;tt&gt;some_function() # This is a comment
-some_other_function()&lt;/tt&gt;
+    some_function() # This is a comment
+    some_other_function()

 Includes
 --

 Most source trees have multiple subdirectories to process. These can be handled by Meson's &lt;tt&gt;subdir&lt;/tt&gt; command. It changes to the given subdirectory and executes the contents of &lt;tt&gt;meson.build&lt;/tt&gt; in that subdirectory. All state (variables etc) are passed to and from the subdirectory. The effect is roughly the same as if the contents of the subdirectory's Meson file would have been written where the include command is.

-&lt;tt&gt;test_data_dir = 'data'
-subdir('tests')&lt;/tt&gt;
+    test_data_dir = 'data'
+    subdir('tests')

 ---

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Sun, 03 Mar 2013 19:58:48 -0000</pubDate><guid>https://sourceforge.netad2a9230e69587a96be5662701848d862e92aef1</guid></item><item><title>WikiPage Syntax modified by Jussi Pakkanen</title><link>https://sourceforge.net/p/meson/wiki/Syntax/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -3,7 +3,7 @@

 The syntax of Meson's specification language has been kept as simple as possible. It is *strongly typed* so no object is ever converted to another under the covers. Variables have no visible type which makes *dynamically typed* (also known as *duck typed*).

-The main building blocks of the language are *variables*, *numbers*, *strings*, *arrays*, *function calls*, *method calls*, *if statements* and *includes*.
+The main building blocks of the language are *variables*, *numbers*, *booleans*, *strings*, *arrays*, *function calls*, *method calls*, *if statements* and *includes*.

 Usually one Meson statement takes just one line. There is no way to have multiple statements on one line as in e.g. *C*. Function and method calls' argument lists can be split over multiple lines. Meson will autodetect this case and do the right thing.

@@ -20,6 +20,13 @@
 --

 Meson supports only integer numbers. They are declared simply by writing them out.
+
+Booleans
+--
+
+A boolean is either &lt;tt&gt;true&lt;/tt&gt; or &lt;tt&gt;false&lt;/tt&gt;.
+
+&lt;tt&gt;truth = true&lt;/tt&gt;

 Strings
 --
@@ -48,6 +55,19 @@
 &lt;tt&gt;myobj = some_function()
 myobj.do_something('now')&lt;/tt&gt;

+If statements
+--
+
+If statements work just like in other languages. The only exception is that the value used in the comparison must be a boolean. Strings or numbers will not do.
+
+    var1 = 1
+    var2 = 2
+    if var1 == var2 # Evaluates to false
+      something_broke()
+    else
+      everything_ok()
+    endif
+
 Comments
 --

@@ -56,6 +76,13 @@
 &lt;tt&gt;some_function() # This is a comment
 some_other_function()&lt;/tt&gt;

+Includes
+--
+
+Most source trees have multiple subdirectories to process. These can be handled by Meson's &lt;tt&gt;subdir&lt;/tt&gt; command. It changes to the given subdirectory and executes the contents of &lt;tt&gt;meson.build&lt;/tt&gt; in that subdirectory. All state (variables etc) are passed to and from the subdirectory. The effect is roughly the same as if the contents of the subdirectory's Meson file would have been written where the include command is.
+
+&lt;tt&gt;test_data_dir = 'data'
+subdir('tests')&lt;/tt&gt;

 ---

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jussi Pakkanen</dc:creator><pubDate>Sun, 03 Mar 2013 19:57:33 -0000</pubDate><guid>https://sourceforge.net1def293c825c2ef33ba7d7ebbee332b271af35ad</guid></item></channel></rss>