diff options
Diffstat (limited to 'chunk.d')
| -rw-r--r-- | chunk.d | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -46,7 +46,6 @@ abstract class Seq { abstract Value first(); abstract Seq rest(); abstract int length(); - abstract Seq concat(Seq seq); abstract bool isIn(Value val); } @@ -75,7 +74,7 @@ class String : Seq { return to!int(str.length); } - override Seq concat(Seq seq) { + Seq concat(Seq seq) { if (seq.type != SeqType.STRING) { // how do i throw an error here? writeln("must concat strings to strings!"); @@ -138,13 +137,13 @@ class List : Seq { return to!int(this.inner.length); } - override Seq concat(Seq seq) { + Seq append(Value val) { int length = to!int(this.inner.length); List ret = new List(length + 1); for (int i = 0; i < length; i++) { ret.addItemAtIndex(this.inner[i], i); } - ret.addItemAtIndex(makeSeqValue(seq), length); + ret.addItemAtIndex(val, length); return ret; } @@ -189,6 +188,7 @@ enum OpCode { // SEQUENCES OP_CONCAT, // No? + OP_APPEND, OP_FIRST, // No? OP_LENGTH, OP_MEMBER, |
