roxen.lists.pike.general

Subject Author Date
Changing Pike code on the fly Mirar @ Pike importmöte för m <6341[at]lyskom[dot]lysator[dot]liu[dot]se> 21-01-2009
You can't change an existing class, but you can create new classes, so
it's very much up to the rest of your environment to use the new class
instead of the old class, so something like this:

object the_output_thingie;

....
   the_output_thingie=Default_Output_Thingie();
....

void do_the_output(data)
{
   the_output_thingie->output(data);
}

....

void new_output_program(string prog)
{
   program output_program=compile_string(prog);
   the_output_thingie=output_program(); 
}



(It's a little more intricate if you want to display the errors to a
user, but not much.)