No, that is a topic that surfaces occasionally. The encode_value function in Pike can encode objects to strings that can be stored on disk, stored in databases, sent over the net etc. It however needs to have access to the program the object came from and it needs the object to have an encode method that the Codec can call. The encode method should transform all the internal states of the object to a "plain" data structure (int/float/string/array/mapping/multiset). Since most objects have no other state and dependencies than the values in their variables, it would make sense to have this behaviour built into Pike in case there is no encoding method in the object.
/ Martin Nilsson (har bott i google)
Previous text:
2003-02-28 00:55: Subject: Save_Object
Coming from a LPC compiler background, is there anything within PIKE that would lean towards the save_object 'kfun' they have implemented in several compilers?
What I am looking for is a function to take all the variables of an object and save them to a file. Vice-Versa there would be a function to load all those variables back into a cloned object.
Anything or am I blowing smoke?
/ Brevbäraren