I see, has to be like this:
proc main() =
var
s: string
proc `+`(a:string|char, b:string|char): string =
a & b
template fused2{a = `&`(a,b)}(a:var string,b:string|char) = a.add(b)
template fused4{a = `+`(a,b)}(a:var string,b:string|char) = a.add(b)
echo 'a' + 'b'
echo 'a' + "b"
echo "a" + 'b'
echo "a" + "b"
for _ in 0..50_000_000:
s = s + 'x'
s = s + "x"
echo len(s)
main()
Run
- NvP: s = s & 'x' HashBackupJim
- Re: NvP: s = s & 'x' Araq
- Re: NvP: s = s & 'x' mratsim
- Re: NvP: s = s & 'x' juancarlospaco
- Re: NvP: s = s & 'x' HashBackupJim
- Re: NvP: s = s & 'x' shirleyquirk
- Re: NvP: s = s & 'x' shirleyquirk
- Re: NvP: s = s & 'x' HashBackupJim
- Re: NvP: s = s & 'x' HashBackupJim
- Re: NvP: s = s & 'x' HashBackupJim
