<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://odden.us:443/thadar/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AForm_of%2Ffunctions</id>
	<title>Module:Form of/functions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://odden.us:443/thadar/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AForm_of%2Ffunctions"/>
	<link rel="alternate" type="text/html" href="https://odden.us:443/thadar/wiki/index.php?title=Module:Form_of/functions&amp;action=history"/>
	<updated>2026-04-11T18:52:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://odden.us:443/thadar/wiki/index.php?title=Module:Form_of/functions&amp;diff=1236&amp;oldid=prev</id>
		<title>Oa10712: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://odden.us:443/thadar/wiki/index.php?title=Module:Form_of/functions&amp;diff=1236&amp;oldid=prev"/>
		<updated>2022-09-06T03:48:28Z</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 22:48, 5 September 2022&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>Oa10712</name></author>
	</entry>
	<entry>
		<id>https://odden.us:443/thadar/wiki/index.php?title=Module:Form_of/functions&amp;diff=1235&amp;oldid=prev</id>
		<title>en&gt;Erutuon: Protected &quot;Module:form of/functions&quot;: Highly visible template/module ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://odden.us:443/thadar/wiki/index.php?title=Module:Form_of/functions&amp;diff=1235&amp;oldid=prev"/>
		<updated>2019-11-10T23:10:50Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/thadar/wiki/index.php?title=Module:Form_of/functions&quot; title=&quot;Module:Form of/functions&quot;&gt;Module:form of/functions&lt;/a&gt;&amp;quot;: Highly visible template/module ([Edit=Allow only template editors and administrators] (indefinite) [Move=Allow only template editors and administrators] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[=[&lt;br /&gt;
DISPLAY_HANDLERS is a list of one or more functions that provide special&lt;br /&gt;
handling for multipart tags. Each function takes formerly a single argument&lt;br /&gt;
(the multipart tag), now temporarily two arguments (the multipart tag and&lt;br /&gt;
the join strategy, which can be nil to use the default), and should either&lt;br /&gt;
return the formatted display text or nil to check the next handler. If no&lt;br /&gt;
handlers apply, there is a default handler that appropriately formats most&lt;br /&gt;
multipart tags.&lt;br /&gt;
&lt;br /&gt;
CAT_FUNCTIONS is a map from function names to functions of a single argument,&lt;br /&gt;
as described in [[Module:form of/cats]]. There are two types of functions:&lt;br /&gt;
condition handlers (which return true or false) and spec handlers (which&lt;br /&gt;
return a specification, as described in [[Module:form of/cats]]). We need to&lt;br /&gt;
put the functions here rather than in [[Module:form of/cats]] because that&lt;br /&gt;
module is loaded using mw.loadData(), which can&amp;#039;t directly handle functions.&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local export = {}&lt;br /&gt;
&lt;br /&gt;
function export.multipart_join_strategy()&lt;br /&gt;
	-- Recognized values:&lt;br /&gt;
	-- &amp;quot;and&amp;quot;: Join with &amp;quot;and&amp;quot;, using commas for 3 or more items&lt;br /&gt;
	-- &amp;quot;en-dash&amp;quot;: Join with – (en-dash)&lt;br /&gt;
	-- &amp;quot;slash&amp;quot;: Join with / (slash)&lt;br /&gt;
	return &amp;quot;slash&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function wrap_in_inflection_of_sep(text)&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;inflection-of-sep&amp;quot;&amp;gt;&amp;#039; .. text .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
-- This is a local version of serialCommaJoin from [[Module:table]] that&lt;br /&gt;
-- implements it a bit differently.&lt;br /&gt;
local function join_multiparts_with_serial_comma(seq)&lt;br /&gt;
	local length = #seq&lt;br /&gt;
&lt;br /&gt;
	if length == 0 then&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	elseif length == 1 then&lt;br /&gt;
		return seq[1] -- nothing to join&lt;br /&gt;
	elseif length == 2 then&lt;br /&gt;
		return seq[1] .. wrap_in_inflection_of_sep(&amp;quot;&amp;amp;#32;and&amp;amp;#32;&amp;quot;) .. seq[2]&lt;br /&gt;
	else&lt;br /&gt;
		local comma = &amp;#039;&amp;lt;span class=&amp;quot;serial-comma&amp;quot;&amp;gt;,&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
		local conj = &amp;#039;&amp;lt;span class=&amp;quot;serial-and&amp;quot;&amp;gt;&amp;amp;#32;and&amp;amp;#32;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
		return table.concat(seq, wrap_in_inflection_of_sep(&amp;quot;,&amp;amp;#32;&amp;quot;), 1, length - 1) ..&lt;br /&gt;
			wrap_in_inflection_of_sep(comma .. conj) .. seq[length]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function export.join_multiparts(parts, joiner)&lt;br /&gt;
	-- Display the elements of a multipart tag. Currently we use &amp;quot;and&amp;quot;,&lt;br /&gt;
	-- with commas when then are three or more elements, of the form&lt;br /&gt;
	-- &amp;quot;foo, bar, baz and bat&amp;quot;; but we are seriously considering switching&lt;br /&gt;
	-- to en-dash, e.g. &amp;quot;foo–bar–baz–bat&amp;quot;. Arguably,&lt;br /&gt;
	--   dative–ablative masculine–feminine–neuter plural&lt;br /&gt;
	-- looks better then&lt;br /&gt;
	--   dative and ablative masculine, feminine and neuter plural&lt;br /&gt;
	-- and&lt;br /&gt;
	--   first–second–third-person singular present subjunctive&lt;br /&gt;
	-- looks better than&lt;br /&gt;
	--   first-, second- and third-person singular present subjunctive&lt;br /&gt;
	local strategy = joiner or export.multipart_join_strategy()&lt;br /&gt;
	local retval&lt;br /&gt;
	if strategy == &amp;quot;and&amp;quot; then&lt;br /&gt;
		retval = join_multiparts_with_serial_comma(parts)&lt;br /&gt;
	elseif strategy == &amp;quot;en-dash&amp;quot; then&lt;br /&gt;
		retval = table.concat(parts, wrap_in_inflection_of_sep(&amp;quot;–&amp;quot;))&lt;br /&gt;
	elseif strategy == &amp;quot;slash&amp;quot; then&lt;br /&gt;
		retval = table.concat(parts, wrap_in_inflection_of_sep(&amp;quot;/&amp;quot;))&lt;br /&gt;
	else&lt;br /&gt;
		error(&amp;quot;Unrecognized multipart join strategy: &amp;quot; .. strategy)&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;inflection-of-conjoined&amp;quot;&amp;gt;&amp;#039; .. retval .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
export.cat_functions = {}&lt;br /&gt;
&lt;br /&gt;
export.display_handlers = {}&lt;br /&gt;
&lt;br /&gt;
-- Display handler to clean up display of multiple persons by omitting&lt;br /&gt;
-- redundant &amp;quot;person&amp;quot; in all but the last element. For example, the tag&lt;br /&gt;
-- &amp;quot;123&amp;quot; maps to &amp;quot;1//2//3&amp;quot;, which in turn gets displayed as (approximately)&lt;br /&gt;
-- &amp;quot;first-, second- and third-person&amp;quot; (with appropriate glossary links, and&lt;br /&gt;
-- appropriate spans marking the serial comma).&lt;br /&gt;
table.insert(export.display_handlers,&lt;br /&gt;
	function(tags, joiner)&lt;br /&gt;
		local els = {}&lt;br /&gt;
		local numtags = #tags&lt;br /&gt;
		local strategy = joiner or export.multipart_join_strategy()&lt;br /&gt;
		for i, tag in ipairs(tags) do&lt;br /&gt;
			local suffix = i == numtags and &amp;quot;-person]]&amp;quot; or&lt;br /&gt;
				strategy == &amp;quot;and&amp;quot; and &amp;quot;-]]&amp;quot; or &amp;quot;]]&amp;quot;&lt;br /&gt;
			if tag == &amp;quot;first-person&amp;quot; then&lt;br /&gt;
				table.insert(els, &amp;quot;[[Appendix:Glossary#first person|first&amp;quot; .. suffix)&lt;br /&gt;
			elseif tag == &amp;quot;second-person&amp;quot; then&lt;br /&gt;
				table.insert(els, &amp;quot;[[Appendix:Glossary#second person|second&amp;quot; .. suffix)&lt;br /&gt;
			elseif tag == &amp;quot;third-person&amp;quot; then&lt;br /&gt;
				table.insert(els, &amp;quot;[[Appendix:Glossary#third person|third&amp;quot; .. suffix)&lt;br /&gt;
			else&lt;br /&gt;
				return nil&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return export.join_multiparts(els, joiner)&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
return export&lt;br /&gt;
&lt;br /&gt;
-- For Vim, so we get 4-space tabs&lt;br /&gt;
-- vim: set ts=4 sw=4 noet:&lt;/div&gt;</summary>
		<author><name>en&gt;Erutuon</name></author>
	</entry>
</feed>