This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Lion4ever's profile picture

[1.75][SMP/SSP] rom-program functions in _ENV

Started by Lion4ever, 31 May 2015 - 06:03 PM
Lion4ever #1
Posted 31 May 2015 - 08:03 PM
If I run some rom/ programs and call and look in _ENV afterwards there are some new values which should not be there.

VERSION:
1.75
DESCRIPTION:
Variables/Functions from some programs in the rom/ directory stay in _ENV after the program was called
EXPECTED RESULT:
I expected _ENV to be empty
REPRODUCTION STEPS:
shell.run("edit","something")
assert(_ENV.stringColour == nil, "This was not there before")

I made a list (using this program) of the places i found missing local statements:


adventure:610: attempt to create global function "doCommand" in the current environment
adventure:476: attempt to create global function "findItem" in the current environment
worm:20: attempt to create global function "printCentred" in the current environment
help:1: attempt to create global table "tArgs" in the current environment
monitor:2: attempt to create global function "printUsage" in the current environment
edit:31: attempt to create global number "stringColour" in the current environment
redirection:178: attempt to create global table "fLevel" in the current environment
I hope i did not miss any

Best thing: the doCommand function from adventure lets you continue to play after you died without any time-states passing by :D/>
Edited on 05 December 2015 - 03:20 PM
Lion4ever #2
Posted 28 June 2015 - 01:17 AM
Now for 1.74
Lion4ever #3
Posted 05 December 2015 - 04:20 PM
Now for 1.75
apemanzilla #4
Posted 10 December 2015 - 11:26 PM
Haven't actually tested it but looking through the rom for 1.76pr2 it seems that this is still present.
Wojbie #5
Posted 10 December 2015 - 11:49 PM
I completly forgot about this bug. I will repost this list on github.

Edit: Link : https://github.com/dan200/ComputerCraft/issues/30
Edited on 10 December 2015 - 11:27 PM
Bomb Bloke #6
Posted 11 December 2015 - 12:15 AM
Having a link to the github issue in each bug thread (assuming the bug can still be reproduced under 1.76beta), or at least a thread bump if the bug can't be reproduced any more, would make it a lot easier for other people running through this section to see which threads they can ignore.
Wojbie #7
Posted 11 December 2015 - 01:04 AM
Having a link to the github issue in each bug thread (assuming the bug can still be reproduced under 1.76beta), or at least a thread bump if the bug can't be reproduced any more, would make it a lot easier for other people running through this section to see which threads they can ignore.