Skip to content

Maps and strings

Compare
Choose a tag to compare
@mandelsoft mandelsoft released this 20 Feb 16:13
· 274 commits to master since this release

Added some new string based functions:

  • replace replace stub strings
  • contains extended to check also for sub strings in addition to list entries
  • index find first occurence of substring
  • lastindex find last occurence

To support better creation of dynamic maps and map entries within user defined functions and mapping expressions
the function makemap has been added and dynaml syntax has been extended to support map literals. Map literals
allow to desribe both, keys and values with dynaml expressions.

e.g.:

k: name
a: age
age: 25
map: (( { k="alice", a=age } ))

provides a map

map:
  name: alice
  age: 25

Additionally the new boolean function valid can be used to check for defined expressions evaluating to non-null values.

Besides new functionality, some problems are fixed:

  • lists containing merge entries were merged as index lists even if the entries contain key fields.
  • lists containing expressions as value of key fields were not merged correctly. Now it is possible to
    use simple expressions here. There might still be combinations preventing the correct key evaluation prior to
    merging.