blob: 1eba6740bc1331c296d1dfbc160665b90477ccd7 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstrad59c3892019-11-28 20:53:39 +01002 object to_object(string arg)
3 object to_object(closure arg)
4 object to_object(object arg)
MG Mud User88f12472016-06-24 23:31:02 +02005
Zesstrad59c3892019-11-28 20:53:39 +01006 (object)<value>
MG Mud User88f12472016-06-24 23:31:02 +02007
Zesstra715ec202025-07-09 22:18:31 +02008DESCRIPTION
9 The argument is converted into an object, if possible.
Zesstrad59c3892019-11-28 20:53:39 +010010
Zesstra715ec202025-07-09 22:18:31 +020011 For strings, the object with a matching object_name() is
12 returned, or 0 if there is none, as find_object() does.
Zesstrad59c3892019-11-28 20:53:39 +010013
Zesstra715ec202025-07-09 22:18:31 +020014 For (bound!) closures, the object holding the closure is
15 returned (for 'alien lfun closures' this is the object which
16 created the closure, not the object the lfun is defined in).
Zesstrad59c3892019-11-28 20:53:39 +010017
Zesstra715ec202025-07-09 22:18:31 +020018 Objects and the number 0 return themselves.
Zesstrad59c3892019-11-28 20:53:39 +010019
Zesstra715ec202025-07-09 22:18:31 +020020BUGS
21 The cast notation only works if the precise type of <value>
22 is known at compile-time. This will not be fixed - use the
23 function form instead.
Zesstrad59c3892019-11-28 20:53:39 +010024
Zesstra715ec202025-07-09 22:18:31 +020025SEE ALSO
26 find_object(E), to_array(E), to_int(E), to_string(E),
27 get_type_info(E)