Skip to content

Cool example of deep walk fn #78

@chrismo

Description

@chrismo

Added as a test case for this PR|6325

spq: |
  fn walk(v):
    case kind(v)
    when "array" then 
      [unnest v | walk(this)]
    when "record" then 
      unflatten([unnest flatten(v) | {key,value:walk(value)}])
    else v+1
    end
  values walk([{x:[1,2]},{y:3}])

output: |
  [{x:[2,3]},{y:4}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions