Must we recompile a script if one of its dependencies has be

Post » Tue Nov 20, 2012 11:20 am

Hello.

Imagine I have a script "Caller" that calls another script "Callee.Something()". If I change the body of Callee.Something (the signature being unchanged), must I also recompile Caller?

So far I always recompiled everything, this gets quickly tiring. ;)
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Tue Nov 20, 2012 2:14 am

I would assume not. The Caller simply refers to the function in the Callee. So long as the function name is the same in the Callee, it's contents are loaded WHEN the Caller calls the function, so a recompile would not be needed.
User avatar
neil slattery
 
Posts: 3358
Joined: Wed May 16, 2007 4:57 am

Post » Tue Nov 20, 2012 3:44 am

I have extensivelly used scripts calling each other and there is no problem in chaning the caller or the called, in regard to each other. Of course, you need to maintain the calling line and the receiving function with the same paramethers (you don't need to use all the paramethers in the calling if some of them are set by deffault in the called function -just assing a value to the paramether in the header definition of each paramether, instead of type paramether, just type type paramether = value).
User avatar
anna ley
 
Posts: 3382
Joined: Fri Jul 07, 2006 2:04 am

Post » Tue Nov 20, 2012 6:03 am

Thanks to both for your answers and especially to amgepo for the confirmation that doesn't cause problems even when repeatedly used. :smile:

I would assume not. The Caller simply refers to the function in the Callee. So long as the function name is the same in the Callee, it's contents are loaded WHEN the Caller calls the function, so a recompile would not be needed.
This actually depends on how the function is refered to, it does not have to be by the name. And if I remember correctly the last time I looked at a pex file, it was not by name. :wink:
If it has been an index or an address offset, for example, adding a new function would likely mess it up. Fortunately Beth apparently used something else (hashcode?) or they have been smart with their indices.
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Tue Nov 20, 2012 10:48 am

This actually depends on how the function is refered to, it does not have to be by the name. And if I remember correctly the last time I looked at a pex file, it was not by name. :wink:
If it has been an index or an address offset, for example, adding a new function would likely mess it up. Fortunately Beth apparently used something else (hashcode?) or they have been smart with their indices.

Well, you did just say that you changed something in the body of Callee.Something, not added anything else to its parent script.

But yes, it works either way. However they did it was micely designed because not having to recompile both scripts is nice.
User avatar
Roy Harris
 
Posts: 3463
Joined: Tue Sep 11, 2007 8:58 pm

Post » Mon Nov 19, 2012 9:26 pm

One thing that may trip you up: If you change the default value of a parameter to a function then the new default value won't be picked up until you re-compile the scripts that call the function, becaue default parameter values are baked into the call site (like C). Otherwise, as long as the function signature doesn't change you don't need to re-compile the calling scripts.
User avatar
Jhenna lee Lizama
 
Posts: 3344
Joined: Wed Jun 06, 2007 5:39 am

Post » Tue Nov 20, 2012 12:50 am

Thank you for the clarification and the precision, SmkViper. :)
This could prevent some unfortunate surprises.
User avatar
meghan lock
 
Posts: 3451
Joined: Thu Jan 11, 2007 10:26 pm


Return to V - Skyrim