# See the License for the specific language governing permissions and
# limitations under the License.
-var x :String = new RopeString
+import core
+intrude import core::text::ropes
-x = x + "NODE"
-x = x + "AT"
-x = x + "TEST"
+# Force building a Rope
+redef fun maxlen: Int do return once 2
+
+var x :String = new Concat("NODE", "AT")
+
+x += "TEST"
print x
var lst = new List[String]
-lst.push(new RopeString.from("ZZ"))
+lst.push("ZZ")
lst.push((lst.last * 5))
print ss
-ss = ss.as(RopeString).insert_at("DD", 2)
+ss = ss.insert_at("DD", 2)
print ss
var atb = new Array[String]
-var s = new RopeString
-s = s.prepend(".types").as(RopeString)
-s = s.prepend("./examples/hello_world.nit".substring(11,11)).as(RopeString)
-s = s.append(".").as(RopeString)
-s = s.append("1").as(RopeString)
-s = s.append(".o").as(RopeString)
+var s: String = "./examples/hello_world.nit".substring(11,11) + ".types"
+s += "."
+s += "1"
+s += ".o"
print s
-var str = new RopeString.from("now") + " step" + " live..."
+var str = "now" + " step" + " live..."
print str
for i in str.chars.iterator_from(str.length-1) do printn i
printn "\n"
-for i in str.as(RopeString).reverse_substrings_from(12) do printn i
-printn "\n"
-
for i in str.chars.reverse_iterator do printn i
printn "\n"
for i in str.chars.reverse_iterator_from(0) do printn i
printn "\n"
-var str2 = str.as(RopeString).insert_at(str.substring_from(3), 3)
+var str2 = str.insert_at(str.substring_from(3), 3)
print str2