I’ve got a variable that I would like to use as default value for an argument:
proc log {message {output $::output}} {
....
}
Is there a way to do this or need I to evaluate the variable inside my proc?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, but you cannot use curly braces (
{}) for your argument list. You declare the procedure e.g. this way:But be aware:
The variable is evaluated at the time when the procedure is declared, not when it is executed!