Am 23.04.2025 um 14:33 schrieb Artur T.:
Am 23.04.25 um 13:48 schrieb Sven Schreiber:

True, but one could just decide to print the array in some way. Personally, I would go for "vertically".
...
Yes, my (not explicitly mentioned before) point is that this is not so obvious for (most?)  users, I would assume. You have to know about the flatten() function just for a formatted printing of a string array. I think that can be simplified.

Well, what does "just work" is to do simply:

print S

Of course, that's unformatted printing, but is as simple as it gets. I'd argue that if people have special formatting needs and are using array types in their code, it's not too much to ask that they learn a little how to handle arrays in hansl.

But anyway, I'm certainly not against new features, just saying that IMHO it's not high priority.


In the end I don't think that more syntax than that is needed. Note also the difference to gretl's specialized %m formatting feature for matrix-es: A matrix is 2-dim, so flatten() would mess that up in general. In contrast, a strings array is only 1-dim, so no problem.

In the best case, there is no need to have another syntactic sugar. By the way, for a matrix (also an array) you can use the following which works for any numeric data type (apart from "matrices", I think):

Yeah, that's what I meant. The '%m' I mentioned was rubbish, though.

-s