463 posts
Location
Germany
Posted 19 August 2012 - 04:58 PM
Its only a very little suggestion, and I don't think its really needed, but you can save functions as strings.
string.dump(thefunction)
returns the string of the function, so textutils.serialize could serialize functions, and loaded programs!
(loadfile(pathtofile) returns the file as a function)
864 posts
Location
Sometime.
Posted 19 August 2012 - 05:02 PM
I like the idea but I don't see the need..
You could just do
code = [[
function forward
turtle.forward()
end ]]
rednet.send(id, code)
463 posts
Location
Germany
Posted 19 August 2012 - 05:18 PM
yes, but its costly… you can send the whole (almost the whole) _G table without opening the bios and sending the strings of a function
724 posts
Posted 19 August 2012 - 05:25 PM
There are problems with string.dump result.
Strings with high bit saved/loaded with errors.
463 posts
Location
Germany
Posted 20 August 2012 - 08:46 AM
I only have errors if I use string.dump with functions like term.write…
997 posts
Location
Wellington, New Zealand
Posted 20 August 2012 - 01:10 PM
What happens to upvalues?
496 posts
Location
New Zealand
Posted 20 August 2012 - 01:34 PM
What happens to upvalues?
They dissappear into the ether :D/>/>
724 posts
Posted 20 August 2012 - 04:48 PM
I only have errors if I use string.dump with functions like term.write…
Show me your file io. Is it binary?
What happens to upvalues?
Is seems they become nils.