<?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=Struct</id>
	<title>Struct - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://coderwiki.org/index.php?action=history&amp;feed=atom&amp;title=Struct"/>
	<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Struct&amp;action=history"/>
	<updated>2026-05-19T08:29:36Z</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=Struct&amp;diff=101&amp;oldid=prev</id>
		<title>Dylan: new: info, example, other algebraic</title>
		<link rel="alternate" type="text/html" href="http://coderwiki.org/index.php?title=Struct&amp;diff=101&amp;oldid=prev"/>
		<updated>2025-08-15T08:36:05Z</updated>

		<summary type="html">&lt;p&gt;new: info, example, other algebraic&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;struct&amp;#039;&amp;#039;&amp;#039; is a &amp;#039;&amp;#039;&amp;#039;user-defined&amp;#039;&amp;#039;&amp;#039; [[data type]].&lt;br /&gt;
&lt;br /&gt;
It is a [[product type]] - a [[data type]] made by combining multiple [[Field|fields]] together into a single type.&lt;br /&gt;
&lt;br /&gt;
== Example: a &amp;#039;Rectangle&amp;#039; struct ==&lt;br /&gt;
As structs store multiple different [[Field|fields]] in a single collection, we can make a &amp;lt;code&amp;gt;Rectangle&amp;lt;/code&amp;gt; struct like this (written in [[Rust]] for this example):&amp;lt;syntaxhighlight lang=&amp;quot;rust&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
struct Rectangle {&lt;br /&gt;
    width: u32,&lt;br /&gt;
    height: u32,&lt;br /&gt;
    color: Color,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;And our &amp;lt;code&amp;gt;Color&amp;lt;/code&amp;gt; struct could look like this, another [[product type]]:&amp;lt;syntaxhighlight lang=&amp;quot;rust&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
struct Color {&lt;br /&gt;
    red: u8,&lt;br /&gt;
    green: u8,&lt;br /&gt;
    blue: u8,&lt;br /&gt;
    alpha: u8,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other algebraic data types ==&lt;br /&gt;
Please see: [[Algebraic data type]]&lt;/div&gt;</summary>
		<author><name>Dylan</name></author>
	</entry>
</feed>