aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormryouse2023-06-06 20:41:19 -0400
committermryouse2023-06-06 20:41:19 -0400
commitd246597ef728ec74152c93eea00ff2c9585ef716 (patch)
treee5107fe26b58d54dacc71c9ab1ba51c586bbe18a
parent59d076f6dc179315b6dfc1c141dc9ee48cc66a54 (diff)
bugfix: first and last should return Seqs
-rw-r--r--chunk.d6
1 files changed, 4 insertions, 2 deletions
diff --git a/chunk.d b/chunk.d
index fb1f97c..c8d280e 100644
--- a/chunk.d
+++ b/chunk.d
@@ -66,7 +66,8 @@ class String : Seq {
}
override Value first() {
- return makeStringValue(to!string(this.str[0]));
+ string ret = to!string(this.str[0]);
+ return makeSeqValue(new String(ret));
}
override Seq rest() {
@@ -87,7 +88,8 @@ class String : Seq {
}
override Value last() {
- return makeStringValue(to!string(this.str[$ - 1]));
+ string ret = to!string(this.str[$ - 1]);
+ return makeSeqValue(new String(ret));
}
override int length() {