ref: 9edbd938a58bdcd53f38bc4b8fcdae73177432c4
parent: 49d55e7425056ea5704fffe9f19f76c659079348
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Feb 4 16:14:50 EST 2016
Make std.sljoin consistent.
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -536,7 +536,7 @@
var ret
std.assert(f.rstart + n <= f.rend, "Reading too much from buffer")
- ret = std.sljoin(buf, f.rbuf[f.rstart:f.rstart + n])
+ ret = std.sljoin(&buf, f.rbuf[f.rstart:f.rstart + n])
f.rstart += n
-> ret
}
--- a/lib/std/sljoin.myr
+++ b/lib/std/sljoin.myr
@@ -2,14 +2,14 @@
use "slcp"
pkg std =
- generic sljoin : (dst : @a[:], src : @a[:] -> @a[:])
+ generic sljoin : (dst : @a[:]#, src : @a[:] -> @a[:])
;;
generic sljoin = {dst, src
var len
- len = dst.len
- dst = slgrow(dst, len + src.len)
- slcp(dst[len:], src)
- -> dst
+ len = dst#.len
+ dst# = slgrow(dst#, len + src.len)
+ slcp(dst#[len:], src)
+ -> dst#
}
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -87,7 +87,7 @@
elif std.hassuffix(srcs[i], ".glue.c")
(cflags, libs) = scrapecflags(b, dg, srcs[i])
std.htput(dg.cflags, srcs[i], cflags)
- dg.extlibs = std.sljoin(dg.extlibs, libs)
+ std.sljoin(&dg.extlibs, libs)
dg.dynamic = true
;;
;;
@@ -162,7 +162,7 @@
;;
| `Local (l, lnum):
if !std.hassuffix(l, ".use")
- l = std.sljoin(l, ".use")
+ std.sljoin(&l, ".use")
;;
if obj.len != 0
pushdep(g, l, obj)
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -153,7 +153,10 @@
}
const runcmd = {bin, args
- -> bld.run(std.sljoin(std.sldup([bin][:]), args))
+ var sl
+
+ sl = std.sldup([bin][:])
+ -> bld.run(std.sljoin(&sl, args))
}
const mkbuild = {tags
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -25,8 +25,8 @@
setdir(b, "")
for tn in b.all
match gettarg(b.targs, tn)
- | `Bin bt: tests = std.sljoin(tests, buildtests(b, bt))
- | `Lib lt: tests = std.sljoin(tests, buildtests(b, lt))
+ | `Bin bt: std.sljoin(&tests, buildtests(b, bt))
+ | `Lib lt: std.sljoin(&tests, buildtests(b, lt))
| _: /* nothing */
;;
;;