On Fri, 7 Dec 2012, Sven Schreiber wrote:
Am 07.12.2012 14:57, schrieb Allin Cottrell:
> On Fri, 7 Dec 2012, Sven Schreiber wrote:
>
>> I have loops which create and overwrite bundles, and afterwards I get
>> many bundles with exactly the same names in the icon view. So
>> replacing/overwriting doesn't seem to work. (This is the latest release
>> --not the snapshot-- on windows 7, from the non-admin zip package.) When
>> trying to open (double-clicking) one of these items, gretl crashes.
>>
>> It happens in various settings:
>>
>> * In one case, the bundle is an input argument to a function. What's
>> funny is that the name in the icon view is not the name of the bundle in
>> the outer scope, but the argument name inside the function.
>>
>> * In another case, the bundle is created in the top-level scope of the
>> script, but I also tried to explicitly do 'delete <nameofbundle>'
before
>> creating it again, and it didn't seem to work. Note that here also the
>> bundle is the return value of a function.
>>
>> * In both cases, the number of icons with identical names in the icon
>> view does not seem to coincide with the number of loop repetitions.
>
> Could you post a test-case script, please?
>
I was going to say, no it's not possible, but actually here is one:
<hansl>
open denmark # just for tabula rasa
Off topic, but you can just use "clear" for tabula rasa.
function bundle heyho(bundle indata)
bundle output
matrix m = indata["m1"]
output["m1copied"] = m
return output
end function
bundle passit
loop 10
matrix mtemp = ones(2,2)
passit["m1"] = mtemp
getoutput = heyho(passit)
endloop
</hansl>
Thanks, Sven. I see what you're talking about. The mess-up in
the GUI icon view was specific to the case where the icon view
is shown automatically. I had that turned off and so was not
seeing the bad stuff; if you opened the icon view manually
after running a script everything was OK.
Anyway, I believe this is now fixed in CVS and snapshots.
Here's a script I used for testing:
<hansl>
function bundle bunfun (bundle argb)
print argb
bundle bcpy = argb
return bcpy
end function
clear
bundle bun0
bun0["x"] = 0
loop i=1..4 -q
bundle b_$i
b_$i["str"] = "$i"
bun0["x"] = i
bundle extra = bunfun(b_$i)
endloop
print bun0
</hansl>
Allin