<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://coderwiki.org/index.php?action=history&amp;feed=atom&amp;title=Code_block</id>
	<title>Code block - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://coderwiki.org/index.php?action=history&amp;feed=atom&amp;title=Code_block"/>
	<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Code_block&amp;action=history"/>
	<updated>2026-05-19T02:45:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://coderwiki.org/index.php?title=Code_block&amp;diff=156&amp;oldid=prev</id>
		<title>Dylan: new: info, uses, evaluation</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Code_block&amp;diff=156&amp;oldid=prev"/>
		<updated>2025-08-21T13:53:26Z</updated>

		<summary type="html">&lt;p&gt;new: info, uses, evaluation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A &amp;#039;&amp;#039;&amp;#039;code block&amp;#039;&amp;#039;&amp;#039; is a section of [[source code]] that is &amp;#039;&amp;#039;isolated&amp;#039;&amp;#039; in some way from other parts of the [[program]].&lt;br /&gt;
&lt;br /&gt;
This often means that [[Variable|variables]] that are [[Variable declaration|declared]] &amp;#039;&amp;#039;inside&amp;#039;&amp;#039; the code block cannot be referenced &amp;#039;&amp;#039;outside&amp;#039;&amp;#039; the code block. But code blocks can have other functions.&lt;br /&gt;
&lt;br /&gt;
== Uses of code blocks ==&lt;br /&gt;
&lt;br /&gt;
* Declaring the body of a [[subroutine]]&lt;br /&gt;
* Declaring the body of an [[if statement]], [[switch statement]] or other [[Condition|conditional statement]]&lt;br /&gt;
* Declaring the body of a [[while loop]], [[for loop]] or other [[Iteration|iterative statement]]&lt;br /&gt;
&lt;br /&gt;
== Evaluation ==&lt;br /&gt;
In some [[Programming language|languages]] such as [[Rust]], code blocks have another use: to [[Evaluation|evaluate]] multiple [[Statement|statements]] down to a single [[value]].&lt;br /&gt;
&lt;br /&gt;
Usually, the last [[statement]] in the &amp;#039;&amp;#039;&amp;#039;code block&amp;#039;&amp;#039;&amp;#039; is taken to be the [[value]] of the code block itself. Code blocks do not always [[Evaluation|evaluate]] to a [[value]] though.&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
</feed>