vrodedanya / naobi

Naobi language
https://vrodedanya.github.io/naobi/
MIT License
4 stars 0 forks source link

[FEATURE] References #21

Open vrodedanya opened 2 years ago

vrodedanya commented 2 years ago

Is your feature request related to a problem? Please describe. Reference allow you to change variable in function without returning it. Pass argument without copying and e.t.c.

Describe the solution you'd like Something like this:

function double(integer& var)
{
    var = var * 2;
}

Describe alternatives you've considered May be user can determine in function calling that will be passed the reference and we don't need to copy value:

integer var = 5;
double(&var);

But i prefer first approach