Skip to content

Text support for grouped parameters #659

Open
@zslayton

Description

@zslayton

Ion 1.1 allows templates to declare that a given template parameter accepts a group of expressions rather than a single one. For example:

// Definition
// The "hobbies" parameter accepts an expression group; in text, 
// the group is delimited by an enclosing `[]`.
(macro person (name [hobbies]) 
    {name: name, hobbies: (make_list hobbies))

// Invocation
(:person "Kunal" ["Bungee jumping", "Baking", "Bird watching"])

// Expansion
{
  name: "Kunal",
  hobbies: [
    "Bungee jumping",
    "Baking",
    "Bird watching"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestion 1.1Related to Ion 1.1

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions