gisikw / ksprogramming

Getting to space with kOS!
https://www.youtube.com/playlist?list=PLb6UbFXBdbCrvdXVgY_3jp5swtvW24fYv
MIT License
99 stars 17 forks source link

orbit.ks use of target as a variable in the target_angle function #9

Closed blnk2007 closed 8 years ago

blnk2007 commented 8 years ago

More of a question than an issue. Since target is already a bound variable in kOS does trying to make a target variable parameter of target_angle function cause problems?

gisikw commented 8 years ago

Nope! Generally speaking, bound variables exist on the global scope, so using target will be fine. It's not a good practice though, and I'm going to try and avoid it in the future. But when trying to determine a value, kOS should look at the innermost context first, then look at the parent context, all the way up to the top global context, where the bound variables live. :)