Here is what I want to know: when a function is called, does this function can recovery the information about which variables pass their values into this function's arguments. I use the following example to show what I want to know.

void main(){
        int a = 1;
        writeln(fun(a.stringof, a));
}

//to return "a is assigned to 1"
string fun(string name, int x)
        return name~" is assigned to "~x;
}

For this example my question turns to become: can the name for fun be derived instead of passing to it?

string fun(int x)
//is there any way we can know that this value x is passed from the variable a in the main function? string name = the name of the variable which passes its value to x
        return name~" is assigned to "~x;
}

Please enlighten me if this can be done, thanks.

Reply via email to