On Mon, 13 May 2013, Sven Schreiber wrote:
Am 12.05.2013 12:27, schrieb Allin Cottrell:
> On Sat, 11 May 2013, Allin Cottrell wrote:
>
>> On Fri, 10 May 2013, Sven Schreiber wrote:
>>
>>> I think I found a bug in gretl that is quite subtle. The attached script
>>> demonstrates the bug -- or actually in its current form it demonstrates how
>>> to work around the bug. [...]
>>
>> Thanks, Sven. Actually, not so terribly subtle. What's broken is the idiom
>>
>> bundle.member -= decrement
>> bundle.member += increment
>>
>> and the moment I saw that I thought "Uh oh, that's not going to work, is
it?"
>> If you replace it with
>>
>> bundle.member = bundle.member - decrement
>> bundle.member = bundle.member + decrement
>>
A related, though not identical, bug:
<hansl>
clear
matrix m = ones(2,2)
bundle b
b.m1 = m
check = b.m1[1,1]
</hansl>
doesn't work (i.e. directly indexing/selecting parts of matrix in a bundle).
I see your point, but I'm not sure I'd describe it as a "bug".
As presently constituted, a bundle is not, and doesn't act
much like, an array. The general idea is that a bundle is
simply a container (literally, a hash table), and you have to
pull an object out of a bundle before you can do anything with
it.
Allin