fluffos/docs/efun/system/function_exists.md
gesslar 5f7fba054f
docs: document the third argument (flag) of function_exists() (#1326)
The EN page only showed the two-argument form. Document the optional
third argument, which admits protected and private functions when
nonzero (matching the implementation in interpret.cc and the existing
zh-CN page), and fix the SYNOPSYS -> SYNOPSIS heading typo.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 18:56:30 -07:00

1,016 B

title
system / function_exists

function_exists

NAME

function_exists()  -  find  the  file containing a given function in an
object

SYNOPSIS

string function_exists( string str, object ob );
string function_exists( string str, object ob, int flag );

DESCRIPTION

Return the file name of the object that defines the function  'str'  in
object  'ob'.  The  returned value can be other than 'file_name(ob)' if
the function is defined by an inherited object.

0 is returned if the function was not defined.

By default, functions that cannot be called from outside the object
(protected and private functions) are treated as not defined. If
'flag' is specified and is nonzero, such functions are reported as
well.

Note that function_exists() does not check shadows.

If no object is passed as the second argument, this efun will default
to this_object().

SEE ALSO

call_other(3), call_out(3), functionp(3), valid_shadow(4)