From 1c60ef5d0b9ee515bfdf963749e76445e40ff93b Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Sun, 28 Jan 2018 16:03:03 +0000 Subject: [PATCH] changed the parent class of ByteArray from Collection to Array. enhanced socket writing a bit --- moo/kernel/Collect.moo | 12 ++---------- moo/kernel/Socket.moo | 3 +-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/moo/kernel/Collect.moo b/moo/kernel/Collect.moo index 4228d32..1be595f 100644 --- a/moo/kernel/Collect.moo +++ b/moo/kernel/Collect.moo @@ -225,17 +225,9 @@ class(#character,#final,#limited,#immutable) Symbol(String) ## ------------------------------------------------------------------------------- -class(#byte) ByteArray(Collection) +class(#byte) ByteArray(Array) { - method at: anInteger - { - ^self basicAt: anInteger. - } - - method at: anInteger put: aValue - { - ^self basicAt: anInteger put: aValue. - } + ## TODO: is it ok for ByteArray to inherit from Array? } ## ------------------------------------------------------------------------------- diff --git a/moo/kernel/Socket.moo b/moo/kernel/Socket.moo index cefe75e..76ba88b 100644 --- a/moo/kernel/Socket.moo +++ b/moo/kernel/Socket.moo @@ -342,7 +342,7 @@ extend Socket if (self.outputReady) { - if ((self _writeBytes: bytes) >= 0) { ^self }. + if ((self _writeBytes: bytes offset: offset length: length) >= 0) { ^self }. self.outputReady := false. }. @@ -517,7 +517,6 @@ error -> exception ##sck writeBytes: #[ $h, $e, $l, $l, $o, $., $., $., C'\n' ]. sck writeBytes: data offset: 0 length: n. }. - } while (true). ].