nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e1eef8
)
lib/core: Bytes is now Writable
author
Lucas Bajolet
<r4pass@hotmail.com>
Thu, 24 Sep 2015 18:46:39 +0000
(14:46 -0400)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Thu, 24 Sep 2015 18:46:39 +0000
(14:46 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/core/stream.nit
patch
|
blob
|
history
diff --git
a/lib/core/stream.nit
b/lib/core/stream.nit
index
b4a0e2b
..
e097f9b
100644
(file)
--- a/
lib/core/stream.nit
+++ b/
lib/core/stream.nit
@@
-425,6
+425,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)