<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Control-Flow on TrustLang</title>
		<link>https://trust-lang.net/en/tags/control-flow/</link>
		<description>Recent content in Control-Flow on TrustLang</description>
		<generator>Hugo</generator>
		<language>en</language>
		
		
		
		
			<lastBuildDate>Wed, 09 Sep 2026 15:37:53 +0300</lastBuildDate>
		
			<atom:link href="https://trust-lang.net/en/tags/control-flow/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Operators</title>
				<link>https://trust-lang.net/en/docs/operators/operators/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://trust-lang.net/en/docs/operators/operators/</guid>
				<description>&lt;h2 id=&#34;arithmetic-operators&#34;&gt;Arithmetic operators&lt;a class=&#34;td-heading-self-link&#34; href=&#34;#arithmetic-operators&#34; aria-label=&#34;Heading self-link&#34;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The arithmetic operators of &lt;em&gt;TrustLang&lt;/em&gt; are applicable to &lt;a href=&#34;https://trust-lang.net/en/docs/types/numbers/&#34;&gt;numeric types&lt;/a&gt; and to assignment&#xA;forms. Each binary operator has a paired analog &lt;code&gt;op=&lt;/code&gt;, which performs the operation and&#xA;assigns the result to the left operand (&lt;code&gt;a += 1;&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&#x9;&lt;thead&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;Operator&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;Action&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/thead&gt;&#xA;&#x9;&lt;tbody&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;code&gt;+&lt;/code&gt; / &lt;code&gt;+=&lt;/code&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;addition&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;code&gt;-&lt;/code&gt; / &lt;code&gt;-=&lt;/code&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;subtraction&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;code&gt;*&lt;/code&gt; / &lt;code&gt;*=&lt;/code&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;multiplication (also applicable for repeating strings)&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;code&gt;/&lt;/code&gt; / &lt;code&gt;/=&lt;/code&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;division (the result is a floating-point number)&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;code&gt;//&lt;/code&gt; / &lt;code&gt;//=&lt;/code&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;integer division rounded toward the smaller value (as in Python)&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;code&gt;%&lt;/code&gt; / &lt;code&gt;%=&lt;/code&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;remainder of integer division&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;There is no separate exponentiation operator (the power is computed by a function/repeated multiplication).&#xA;Arithmetic of rational numbers and &lt;code&gt;:BigInteger&lt;/code&gt; is a separate strict branch: mixing with floating-point&#xA;numbers requires an explicit conversion (see &lt;a href=&#34;https://trust-lang.net/en/docs/types/numbers/&#34;&gt;Numbers and tensors&lt;/a&gt;).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Conditions and loops</title>
				<link>https://trust-lang.net/en/docs/operators/flow/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://trust-lang.net/en/docs/operators/flow/</guid>
				<description>&lt;p&gt;In &lt;em&gt;TrustLang&lt;/em&gt; there is no &lt;code&gt;if&lt;/code&gt; keyword: a condition is checked by a construct that in meaning corresponds to&#xA;the mathematical &amp;ldquo;follows&amp;rdquo; — two dashes and an angle bracket &lt;code&gt;--&amp;gt;&lt;/code&gt;. The notation is easily combined into chains for&#xA;checking several conditions of the &amp;ldquo;else if&amp;rdquo; kind. Below the construct is shown in both forms — the DSL macro&#xA;and the base syntax (about the two notation forms see &lt;a href=&#34;https://trust-lang.net/en/docs/syntax/macros/&#34;&gt;Macros and DSL&lt;/a&gt;):&lt;/p&gt;</description>
			</item>
			<item>
				<title>Expressions and statements</title>
				<link>https://trust-lang.net/en/docs/operators/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://trust-lang.net/en/docs/operators/</guid>
				<description>&lt;p&gt;In &lt;em&gt;TrustLang&lt;/em&gt; &lt;strong&gt;any construct is an expression&lt;/strong&gt; and returns a value, so it can be&#xA;nested inside other expressions. Statements are separated by a semicolon &lt;code&gt;;&lt;/code&gt;; a group of statements&#xA;is enclosed in a code block &lt;code&gt;{ ... }&lt;/code&gt;. The basic rules of blocks and expressions are described in&#xA;&lt;a href=&#34;https://trust-lang.net/en/docs/syntax/&#34;&gt;Syntax&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Handling of emergencies and guarantees of resource release are related to the&#xA;&lt;a href=&#34;https://trust-lang.net/en/docs/safety/memory/&#34;&gt;Memory&lt;/a&gt; model, and typing operators — to the &lt;a href=&#34;../types/type_system/&#34;&gt;Type system&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Return, interrupts and error handling</title>
				<link>https://trust-lang.net/en/docs/operators/errors/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://trust-lang.net/en/docs/operators/errors/</guid>
				<description>&lt;p&gt;A sequence of commands (a &lt;a href=&#34;https://trust-lang.net/en/docs/syntax/#block&#34;&gt;code block&lt;/a&gt;) can be interrupted at any point by&#xA;special interrupt statements. &lt;em&gt;TrustLang&lt;/em&gt; uses two kinds of interrupts, which in&#xA;meaning correspond to their notation:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&amp;ldquo;positive&amp;rdquo;&lt;/strong&gt; interrupt &lt;code&gt;++&lt;/code&gt; — return of a value/through-flow (analog of &lt;code&gt;return&lt;/code&gt;);&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&amp;ldquo;negative&amp;rdquo;&lt;/strong&gt; interrupt &lt;code&gt;--&lt;/code&gt; — error (analog of &lt;code&gt;throw&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;An interrupt can return a value: &lt;code&gt;++ &#39;String&#39; ++&lt;/code&gt; — return a string, &lt;code&gt;-- err --&lt;/code&gt; — &amp;ldquo;throw&amp;rdquo;&#xA;an error (a rough analog of &lt;code&gt;throw err&lt;/code&gt;). If no value is specified, the interrupt returns nothing&#xA;(an empty value).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Reflections on structured programming</title>
				<link>https://trust-lang.net/en/blog/theory/structured-programming/</link>
				<pubDate>Sun, 31 Dec 2023 00:00:00 +0000</pubDate>
				<guid>https://trust-lang.net/en/blog/theory/structured-programming/</guid>
				<description>&lt;p&gt;31 Dec 2023 at 11:53&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://trust-lang.net/en/blog/theory/structured-programming.jpeg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Initially I wanted to title the article in some provocative way, for example, &amp;ldquo;How science can turn into religion&amp;rdquo;, &amp;ldquo;Trapped in the distortions of the meaning of structured programming&amp;rdquo; or &amp;ldquo;What you were not told about structured programming&amp;rdquo;, but in the end I still kept the current title and I hope it does not irritate the readers. And although the other titles are more clickbaity, nevertheless they still reflect the meaning of the article to a greater extent than the neutral &amp;ldquo;reflections&amp;rdquo;.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
