[
https://issues.apache.org/jira/browse/ARIA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16100359#comment-16100359
]
Tal Liron edited comment on ARIA-324 at 7/25/17 5:01 PM:
---------------------------------------------------------
My suggestion is that we remove the dot notation entirely: additional arguments
to ctx would be used to further traverse dicts (and similar nested objects).
This would be a very clean notation, that also conforms to how the
{{get_property}} and {{get_attribute}} functions work.
The problem would be how we handle changing attributes. Currently, the logic is
that if there is just one argument, it is a get, and if it is two argument, it
is a set with the second argument the value to set. So that's why we used a dot
notation instead of just allowing many arguments. I think this is confusing. My
suggestion is to use a new format, with a "=" as penultimate arg.
Examples:
{code}
# Get
ctx node attributes name nested_name1 nested_name2 nested.name.3.with.dots
# Set
ctx node attributes name nested_name1 nested_name2 nested.name.3.with.dots =
newvalue
{code}
was (Author: emblemparade):
My suggestion is that we remove the dot notation entirely: additional arguments
to ctx would be used to further traverse dicts (and similar nested objects).
This would be a very clean notation, that also conforms to how the
{{get_property}} and {{get_attribute}} functions work.
The problem would be how we handle changing attributes. Currently, the logic is
that if there is just one argument, it is a get, and if it is two argument, it
is a set with the second argument the value to set. So that's why we used a dot
notation instead of just allowing many arguments. I think this is confusing. My
suggestion is to use a new format, with a "=" as penultimate arg.
Examples:
{code}
# Get
ctx node attributes name nested_name1 nested_name2 nested.name.3.with.dots
# Set
# ctx node attributes name nested_name1 nested_name2 nested.name.3.with.dots =
newvalue
{code}
> ctx uses dot notation to access sub-properties, but property names can have
> "."
> -------------------------------------------------------------------------------
>
> Key: ARIA-324
> URL: https://issues.apache.org/jira/browse/ARIA-324
> Project: AriaTosca
> Issue Type: Story
> Reporter: Tal Liron
>
> The {{_PathDictAccess}} class splits the property path on ".", but this will
> break if property names have "." in them, which is legal.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)