Signed-off-by: Jean Privat <jean@pryen.org>
# Print `objects` on the standard output (`stdout`).
fun printn(objects: Object...)
do
- sys.stdout.write(objects.to_s)
+ sys.stdout.write(objects.plain_to_s)
end
# Print an `object` on the standard output (`stdout`) and add a newline.
# Concatenate elements.
redef fun to_s
do
+ return plain_to_s
+ end
+
+ # Concatenate element without separators
+ fun plain_to_s: String
+ do
var s = new FlatBuffer
for e in self do if e != null then s.append(e.to_s)
return s.to_s
redef class Array[E]
# Fast implementation
- redef fun to_s
+ redef fun plain_to_s
do
var l = length
if l == 0 then return ""
array.add(i)
end
var i = v.array_instance(array, v.mainmodule.object_type)
- var res = v.send(v.force_get_primitive_method("to_s", i.mtype), [i])
+ var res = v.send(v.force_get_primitive_method("plain_to_s", i.mtype), [i])
assert res != null
return res
end