KSP-KOS / KOS

Fully programmable autopilot mod for KSP. Originally By Nivekk
Other
691 stars 229 forks source link

Feature Request - Explicit Parameter Declaration #2714

Open MathewUlanowski opened 4 years ago

MathewUlanowski commented 4 years ago

I talked about this on the reddit page but Like in many other programming languages you can explicitly define which parameter your setting rather than having to declare the parameters in the order they are set in the function declaration. a rugged example of what I'm talking about is below.

function SomeFunc( parameter1, parameter2, parameter3 ){
    //Function body
};

SomeFunc({
    parameter1: someValue1,
    parameter3: someValue3
});

I think this could really help when using functions that have default parameters that you don't want to overwrite but you need to define the parameter after it where another use of the same function needs to do the inverse this is just one case but it makes the functions inside KOS even more dynamic in the way they can be used instead of breaking some of the basic rules of coding which are don't repeat yourself.

Eforen commented 4 years ago

Unfortunately KerbalScript is just not designed to support this. I am considering writing a new programming language that would support that and would be very type strict but that would take a while.

Eforen commented 4 years ago

I also need to learn more about the underlying OpCode system before I do that.