nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge: Make stream and iterators withable
[nit.git]
/
lib
/
core
/
stream.nit
diff --git
a/lib/core/stream.nit
b/lib/core/stream.nit
index
ecfc77e
..
e8cb232
100644
(file)
--- a/
lib/core/stream.nit
+++ b/
lib/core/stream.nit
@@
-445,6
+445,13
@@
interface Writable
end
end
+redef class Bytes
+ super Writable
+ redef fun write_to(s) do s.write_bytes(self)
+
+ redef fun write_to_string do return to_s
+end
+
redef class Text
super Writable
redef fun write_to(stream) do stream.write(self)