On Sun, 15 Sep 2019, Sven Schreiber wrote:
Am 15.09.2019 um 17:49 schrieb Riccardo (Jack) Lucchetti:
> On Sun, 15 Sep 2019, Sven Schreiber wrote:
>
>> Seems the bread() function is not capable of handling the case of
>> cols="0" (or rows="0") inside the xml-represented bundle.
>
> Thanks Sven, this is now fixed in git. Note that if you store a (2x0)
> matrix into a bundle (like in the example you provided), you're going to
> get a (0x0) matrix when you read it back, so the information on the
> number of rows gets lost. Is that a problem?
Not sure. Since -for example- zeros(0,0)~ones(2,3) works (just verified
that), it might be that nothing is lost in turning zeros(2,0) into
zeros(0,0).
OTOH if as a coder you rely on the fact that zeros(1,0)~ones(2,3) does
_NOT_ work in order to avoid subtle bugs for example, it would be a
problem replacing that with zeros(0,0), because no error is thrown anymore.
Would it be so difficult to restore the row/col information?
Not really. That's now in git. Example:
<hansl>
bundle b = defbundle("m", zeros(2,0))
bwrite(b, "testbun.xml")
bundle br = bread("testbun.xml")
eval br.m
</hansl>
Allin