You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add variables to evaluation namespace of Evaluate, Run Keyword If, ... #2040
Robot's variables should be added to Evaluate keyword's namespace automatically. This also simplifies greatly evaluation of conditions in keywords like Run Keyword If, because they use internally the Evaluate keyword.
*** Keywords ***Example${something} = Set variable value
Run keyword if len(something) == 5 This is executed
Evaluate something.upper()
changed the title [-]`BuiltIn.Evaluate` add variables to namespace automatically[/-][+]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, etc automatically[/+]on Jun 22, 2015
changed the title [-]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, etc automatically[/-][+]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, etc[/+]on Jun 22, 2015
changed the title [-]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, etc[/-][+]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, ...[/+]on Jun 22, 2015
We decided to change the syntax so that automatic variables need a $ prefix like in $example. This both makes it easier to see where variables are used and avoids problems with variables that match Python built-in names.
With the new implementation, for example, $list refers to Robot's variable ${list} and list to Python built-in. It is possible to even have something like list($list).
This change is obviously backwards incompatible with the functionality in RF 2.9 beta 1. This shouldn't be a surprise, though, because release notes already mentioned that the syntax can change.
Documentation of using $variable syntax in expressions has now been updated. This issue ought to be ready to be closed again, but a review (especially new docs) by @jussimalinen would still be great. Comments from others are obviously highly appreciated too.
Activity
[-]`BuiltIn.Evaluate` add variables to namespace automatically[/-][+]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, etc automatically[/+][-]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, etc automatically[/-][+]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, etc[/+][-]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, etc[/-][+]Add variables to evaluation namespace of `Evaluate`, `Run Keyword If`, ...[/+]Implementation and tests for adding variables to evaluation namespace. …
pekkaklarck commentedon Jun 29, 2015
We decided to change the syntax so that automatic variables need a
$prefix like in$example. This both makes it easier to see where variables are used and avoids problems with variables that match Python built-in names.With the new implementation, for example,
$listrefers to Robot's variable${list}andlistto Python built-in. It is possible to even have something likelist($list).This change is obviously backwards incompatible with the functionality in RF 2.9 beta 1. This shouldn't be a surprise, though, because release notes already mentioned that the syntax can change.
BuiltIn: Automatic variables in expression require $ prefix.
BuiltIn: Documented using $variables in expressions. #2040
pekkaklarck commentedon Jun 30, 2015
Documentation of using
$variablesyntax in expressions has now been updated. This issue ought to be ready to be closed again, but a review (especially new docs) by @jussimalinen would still be great. Comments from others are obviously highly appreciated too.jussimalinen commentedon Jul 1, 2015
The evaluating expressions chapter does a good job of explaining the concept. Looks good to me. Closing as done!