On Sun, Feb 8, 2026 at 11:43 AM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
Am 08.02.2026 um 14:39 schrieb Cottrell, Allin:
> On Sun, Feb 8, 2026 at 8:14 AM Sven Schreiber
> <sven.schreiber(a)fu-berlin.de> wrote:
>> # wrong / crash:
>> loop foreach which A
>> string renamed = "_" ~ which
>> endloop
>>
>> </hansl>
>>
>> This happens with 2026a, but I guess it's older than that.
> That's now fixed in git.
Thanks, Allin! One more thought on this, though. As you've no doubt
noticed when you fixed it, this doesn't appear to be related to loops or
strings arrays. Instead here for me the simple following line already
produces the crash:
<hansl-crash>
string s = "_" ~ 1
</hansl-crash>
Hmm. At some point in 2024 there was an attempt to make string
concatenation very flexible: we weren't going to insist on getting two
strings as arguments, one of them could be an array of strings or a
matrix, or a scalar -- except that the scalar case was not actually
supported and led to a crash. In current git I've corrected the scalar
case (previously I just made it an error), though I'm not sure the
full generality is really wanted. Anyway, here are examples of what
you can do:
<gretlcli>
? strings S = defarray("tect", "test", "mote")
? eval "pro" ~ S
Array of strings, length 3
[1] "protect"
[2] "protest"
[3] "promote"
? strings S = defarray("tect", "plat", "mor")
? eval S ~ "onic"
Array of strings, length 3
[1] "tectonic"
[2] "platonic"
[3] "moronic"
? matrix m = {1,2,3}
Generated matrix m
? eval "step" ~ m
Array of strings, length 3
[1] "step1"
[2] "step2"
[3] "step3"
? eval m ~ "step"
Array of strings, length 3
[1] "1step"
[2] "2step"
[3] "3step"
? eval "egg" ~ 1
egg1
Done
</gretlcli>
In the matrix and scalar case negative values are not accepted, and we
use the integer part of non-negative values. That policy is no doubt
debatable too.
Allin