Skip to content

Using scalar variables as list variables is allowed #483

Closed

Description

@spooning

Originally submitted to Google Code by @pekkaklarck on 24 Feb 2010

It would be convenient to be able to use scalar variables containing lists
(or any other iterable) as list variables. It has been possible to use
lists as scalars already some time ( issue 117 ).

If variables can be used as scalars or lists based on needs we don't need
to differentiate them when storing, which will make the implementation
cleaner. The only problem is that it's currently possible to have list and
scalar variables with the same basename (e.g. ${FOO} and @⁠{FOO}), so we
need to deprecate that first.

Activity

  1. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @mkorpela on 13 Mar 2013

    Fixed after r903bfab954bc

  2. added this to the 2.8 milestone on Jun 29, 2014
  3. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @mkorpela on 2 Apr 2013

    Still needs modification to the User Guide.

    I do not agree on the need to deprecate simultaneous usage of list and scalar variable with same basename. This has been a problem already before this feature.

  4. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @mkorpela on 2 Apr 2013

    Updated User Guide in r30a3df1e2df7.

  5. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 9 May 2013

    I agree that this issue is independent on deprecating using scalar and list variables with same name.

    I have been reviewing the code and tests and noticed few issues worth fixing. I'll do that first and then take a look at the docs.

  6. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 9 May 2013

    This issue was updated by revision 21b2640cafdd.

    Fixed some problems in the original implementation:

    1. Added support for extended variable syntax. For example, '@⁠{EXTENDED.list}' now works if '${EXTENDED}' exists and contains 'list' attribute with a list value.
    2. Error when using a scalar variable containing non-list (e.g. '@⁠{TESTNAME}') is reported separately, not with normal "Non-existing variable ..." error.

    Also fixed some issues with tests:
    3) Moved them from core top level suite to variables.
    4) Removed tests not related to using scalars as lists (tested elsewhere in variables suite) and renamed suite accordingly.
    5) Changed extension from *.robot to *.txt.

  7. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 9 May 2013

    This issue was updated by revision d4722c593cc5.

    Did some enhancements to documentation:

    • Separated using list vars as scalars and scalars as lists into separate sections and moved them away under List variables section.
    • Enhanced docs of both of the new sections.
    • Added a note to extended variable syntax that @⁠{EXTENTED.attribute} works.
    • Added a note to for loops that iterating over items in a scalar list works by using the scalar as a list.
  8. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 9 May 2013

    Mikko, can you take a look at the changes I've done? Please close this issue if everything looks good and let me know if you find something weird.

    Enhanced docs mentioned in the previous comment are visible online here:
    http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html#using-list-variables-as-scalars

  9. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @mkorpela on 10 May 2013

    Seems ok.
    Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions