@@ -86,6 +86,16 @@ For generating an abstract tree that includes opcodes, see [docs/qast.markdown](
86
86
* [ hash] ( #hash )
87
87
* [ iterkey] ( #iterkey )
88
88
* [ iterval] ( #iterval )
89
+ - [ Coercion Opcodes] ( #-coercion-opcodes )
90
+ * [ coerce_in] ( #coerce_in )
91
+ * [ coerce_ni] ( #coerce_ni )
92
+ * [ coerce_is] ( #coerce_is )
93
+ * [ coerce_ns] ( #coerce_ns )
94
+ * [ coerce_sn] ( #coerce_sb )
95
+ * [ coerce_si] ( #coerce_si )
96
+ * [ smrt_intify] ( #smrt_intify )
97
+ * [ smrt_numify] ( #smrt_numify )
98
+ * [ smrt_strify] ( #smrt_strify )
89
99
- [ String Opcodes] ( #-string-opcodes )
90
100
* [ chars] ( #chars )
91
101
* [ chr] ( #chr )
@@ -430,6 +440,7 @@ The opcodes are grouped into the following categories:
430
440
* [ Relational / Logic Opcodes] ( #logic )
431
441
* [ Array Opcodes] ( #array )
432
442
* [ Hash Opcodes] ( #hash )
443
+ * [ Corcion Opcodes] ( #coercion )
433
444
* [ String Opcodes] ( #string )
434
445
* [ Unicode Property Opcodes] ( #unicode )
435
446
* [ Conditional Opcodes] ( #conditional )
@@ -932,6 +943,39 @@ while $iter {
932
943
933
944
Returns the value associated with the given key-value pair.
934
945
946
+ # <a id="coercion"</a > Coercion opcodes
947
+
948
+ coerce_ * opcodes do lower level conversion between int, num and str.
949
+ smrt_intify, smrt_numify, smrt_strify respectively try to use the .Int, .Num or .Str method.
950
+ If absent rely on lower level conversions.
951
+
952
+ ## coerce_in
953
+ * ` coerce_in(int --> num) `
954
+
955
+ ## coerce_ni
956
+ * ` coerce_in(num --> int) `
957
+
958
+ ## coerce_is
959
+ * ` coerce_is(int --> str) `
960
+
961
+ ## coerce_ns
962
+ * ` coerce_ns(num --> str) `
963
+
964
+ ## coerce_sn
965
+ * ` coerce_sn(str --> num) `
966
+
967
+ ## coerce_si
968
+ * ` coerce_si(str --> int) `
969
+
970
+ ## smrt_intify
971
+ * ` smrt_intify($o --> int) `
972
+
973
+ ## smrt_numify
974
+ * ` smrt_numify($o --> num) `
975
+
976
+ ## smrt_strify
977
+ * ` smrt_strify($o --> str) `
978
+
935
979
# <a id =" string " ></a > String Opcodes
936
980
937
981
## chars
0 commit comments