At scriptland, when we define function prototypes we define them as globals but 
they seem to be turned into consts in the core.  Does it make sense to actually 
make them globals?

It would allow me to do runtime monkey patching… which I'm not saying I'd ever 
do (wink, wink).  But it would make runtime instrumentation and measurement 
significantly easier for some things.  Here's an example of what I'd like to be 
able to do…

global some_func: function(): string;

function some_func(): string
        {
        return "Original function";
        }

function my_func(): string
        {
        return "monkey patched!";
        }

event bro_init()
        {
        some_func = my_func;
        some_func();
        }

Hopefully this would print "monkey patched!".

Are there any conceptually any major problems with doing this?  We should still 
be able to do parse time typing correctly in this case too I believe.

  .Seth

--
Seth Hall
International Computer Science Institute
(Bro) because everyone has a network
http://www.bro.org/

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
bro-dev mailing list
[email protected]
http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev

Reply via email to