Skip to content

Enhance dot notation to allow nested expressions #7

@birchb1024

Description

@birchb1024

Consider this case:

define:
  $data1:
      atom1: 12
      atom2: 13
  $data2:
      items: 
           atom2
---
$data1,$data2.items

We get an error

Error: Subvariable value { items : atom2  } for not string or int in $data1.$data2.items

because this is being interpreted as `$data1,($data2).items.atom2

The workaround is to declare an intermediate variable:

define:
  $data1:
      atom1: 12
      atom2: 13
  $data2:
      items: 
           atom2
---
define:
   $inter:  $data2.items
---
$data1.$inter

This enhancement is to add sub-expressions to make the evaluation order explicit such as

$data1.[$data2.items]

Thereby eliminating the intermediate variable.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions