blob: 89afa379c1d695f9eb9ced66482db452a5f0a142 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02002 string to_string(mixed)
MG Mud User88f12472016-06-24 23:31:02 +02003
Zesstra715ec202025-07-09 22:18:31 +02004 (string)<value>
MG Mud User88f12472016-06-24 23:31:02 +02005
Zesstra715ec202025-07-09 22:18:31 +02006DESCRIPTION
7 The argument is converted to a string. Works with int, float,
8 object, arrays, structs, symbols, strings and closures.
MG Mud User88f12472016-06-24 23:31:02 +02009
Zesstra715ec202025-07-09 22:18:31 +020010 Converts closures and structs into an appropriate name (this
11 has mostly debugging purposes).
MG Mud User88f12472016-06-24 23:31:02 +020012
Zesstra715ec202025-07-09 22:18:31 +020013 CAVEAT: Arrays are considered exploded strings, ie. arrays of
14 Unicode codepoints (i.e. each number is one Unicode character),
15 and are 'imploded' up to the first non-number entry, whatever
16 comes first. That means that to_string(({ 49, 50 })) will return
17 "12" and not "({ 49, 50 })".
MG Mud User88f12472016-06-24 23:31:02 +020018
Zesstra715ec202025-07-09 22:18:31 +020019BUGS
20 The cast notation only works if the precise type of <value>
21 is known at compile-time. This will not be fixed - use the
22 function form instead.
MG Mud User88f12472016-06-24 23:31:02 +020023
Zesstra715ec202025-07-09 22:18:31 +020024HISTORY
25 LDMud 3.2.8 adds lambda closures to the accepted data types.
26 LDMud 3.3.250 adds structs to the accepted data types.
MG Mud User88f12472016-06-24 23:31:02 +020027
Zesstra715ec202025-07-09 22:18:31 +020028SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020029 to_array(E), to_int(E), to_object(E), to_struct(E), sprintf(E)