<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Afun%2Ftrycall</id>
	<title>Module:fun/trycall - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Afun%2Ftrycall"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:fun/trycall&amp;action=history"/>
	<updated>2026-04-22T04:01:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:fun/trycall&amp;diff=494878&amp;oldid=prev</id>
		<title>Sware: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:fun/trycall&amp;diff=494878&amp;oldid=prev"/>
		<updated>2026-04-21T11:22:49Z</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 11:22, 21 April 2026&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>Sware</name></author>
	</entry>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:fun/trycall&amp;diff=494877&amp;oldid=prev</id>
		<title>wikt&gt;Theknightwho: Protected &quot;Module:fun/trycall&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://linguifex.com/w/index.php?title=Module:fun/trycall&amp;diff=494877&amp;oldid=prev"/>
		<updated>2025-05-09T20:52:16Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/wiki/Module:fun/trycall&quot; title=&quot;Module:fun/trycall&quot;&gt;Module:fun/trycall&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;local fun_is_callable_module = &amp;quot;Module:fun/isCallable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local error = error&lt;br /&gt;
local format = string.format&lt;br /&gt;
local pcall = pcall&lt;br /&gt;
local type = type&lt;br /&gt;
&lt;br /&gt;
local function is_callable(...)&lt;br /&gt;
	is_callable = require(fun_is_callable_module)&lt;br /&gt;
	return is_callable(...)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function catch_values(obj, success, ...)&lt;br /&gt;
	if success then&lt;br /&gt;
		return success, ...&lt;br /&gt;
	-- Error message will only take this exact form if `obj` is not callable,&lt;br /&gt;
	-- because it will contain a traceback if it was thrown further up the&lt;br /&gt;
	-- stack.&lt;br /&gt;
	elseif (...) == format(&amp;quot;attempt to call a %s value&amp;quot;, type(obj)) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return error(...)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[==[&lt;br /&gt;
A special form of {pcall()}, which returns {true} plus the result value(s) if {obj} is callable, or {false} if it isn&amp;#039;t. Errors that occur within the called function are not protected.]==]&lt;br /&gt;
return function(obj, ...)&lt;br /&gt;
	local callable = is_callable(obj, true)&lt;br /&gt;
	if callable then&lt;br /&gt;
		return true, obj(...)&lt;br /&gt;
	elseif callable == false then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	-- If `callable` is nil, there&amp;#039;s a protected metatable, so there&amp;#039;s no way to&lt;br /&gt;
	-- check without doing a protected call.&lt;br /&gt;
	return catch_values(obj, pcall(obj, ...))&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>wikt&gt;Theknightwho</name></author>
	</entry>
</feed>