<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.rosssurnameproject.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ACartesian_with_comma</id>
	<title>Module:Cartesian with comma - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.rosssurnameproject.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ACartesian_with_comma"/>
	<link rel="alternate" type="text/html" href="https://www.rosssurnameproject.net/wiki/index.php?title=Module:Cartesian_with_comma&amp;action=history"/>
	<updated>2026-08-15T20:29:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.3</generator>
	<entry>
		<id>https://www.rosssurnameproject.net/wiki/index.php?title=Module:Cartesian_with_comma&amp;diff=1403&amp;oldid=prev</id>
		<title>Redheadkelly: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.rosssurnameproject.net/wiki/index.php?title=Module:Cartesian_with_comma&amp;diff=1403&amp;oldid=prev"/>
		<updated>2025-10-21T01:24:08Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:24, 21 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Redheadkelly</name></author>
	</entry>
	<entry>
		<id>https://www.rosssurnameproject.net/wiki/index.php?title=Module:Cartesian_with_comma&amp;diff=1402&amp;oldid=prev</id>
		<title>Redheadkelly: Redheadkelly moved page Module:Cartesian categories to Module:Cartesian with comma without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="https://www.rosssurnameproject.net/wiki/index.php?title=Module:Cartesian_with_comma&amp;diff=1402&amp;oldid=prev"/>
		<updated>2025-05-01T04:30:03Z</updated>

		<summary type="html">&lt;p&gt;Redheadkelly moved page &lt;a href=&quot;/wiki/index.php?title=Module:Cartesian_categories&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Module:Cartesian categories (page does not exist)&quot;&gt;Module:Cartesian categories&lt;/a&gt; to &lt;a href=&quot;/wiki/index.php/Module:Cartesian_with_comma&quot; title=&quot;Module:Cartesian with comma&quot;&gt;Module:Cartesian with comma&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local remove, insert, concat = table.remove, table.insert, table.concat&lt;br /&gt;
local split, trim = mw.text.split, mw.text.trim&lt;br /&gt;
local clone = mw.clone&lt;br /&gt;
&lt;br /&gt;
local function cartesian (sets)&lt;br /&gt;
    local product = {}&lt;br /&gt;
    local set = remove (sets)&lt;br /&gt;
    if #sets == 0 then&lt;br /&gt;
        for _, item in ipairs (set) do&lt;br /&gt;
            insert (product, { item })&lt;br /&gt;
        end&lt;br /&gt;
        return product&lt;br /&gt;
    end&lt;br /&gt;
    for __, first in ipairs (cartesian (sets)) do&lt;br /&gt;
        for _, second in ipairs (set) do&lt;br /&gt;
            insert (product, clone (first))&lt;br /&gt;
            insert (product [#product], second)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return product&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function format_array (array, format, separator)&lt;br /&gt;
    local formatted = {}&lt;br /&gt;
    for _, combination in ipairs (array) do&lt;br /&gt;
        insert (formatted, format:format (unpack (combination)))&lt;br /&gt;
    end&lt;br /&gt;
    return concat (formatted, separator)&lt;br /&gt;
end&lt;br /&gt;
        &lt;br /&gt;
return {&lt;br /&gt;
combine = function (frame)&lt;br /&gt;
    local sets = {}&lt;br /&gt;
    local delimiter = frame.args.delimiter or &amp;#039;;&amp;#039;&lt;br /&gt;
    local splitter = &amp;#039;%s*&amp;#039; .. delimiter .. &amp;#039;%s*&amp;#039;&lt;br /&gt;
    local default_format = {}&lt;br /&gt;
    for i, list in ipairs (frame.args) do&lt;br /&gt;
        local items = split (trim (list), splitter)&lt;br /&gt;
        -- If this is the first set, add a comma to items that contain a comma&lt;br /&gt;
        if i == 1 then&lt;br /&gt;
            for j, item in ipairs(items) do&lt;br /&gt;
                if item:find(&amp;#039;,&amp;#039;) then&lt;br /&gt;
                    items[j] = item .. &amp;#039;,&amp;#039;&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        sets[#sets + 1] = items&lt;br /&gt;
        insert (default_format, &amp;#039;%s&amp;#039;)&lt;br /&gt;
    end&lt;br /&gt;
    local format = frame.args.format or concat (default_format, &amp;#039;, &amp;#039;)&lt;br /&gt;
    local separator = frame.args.separator or &amp;#039;\n&amp;#039;&lt;br /&gt;
    return format_array (cartesian (sets), format, separator)&lt;br /&gt;
end&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Redheadkelly</name></author>
	</entry>
</feed>