nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
a06347f
)
Merge: Bytes is now Writable
author
Jean Privat
<jean@pryen.org>
Mon, 28 Sep 2015 14:36:07 +0000
(10:36 -0400)
committer
Jean Privat
<jean@pryen.org>
Mon, 28 Sep 2015 14:36:07 +0000
(10:36 -0400)
As @xymus requested, `Bytes` is now a subclass of `Writable`
Pull-Request: #1738
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
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)