Skip to content

New syntax for dictionaries #101

@danilopedraza

Description

@danilopedraza

I think it would be nice to have a clear syntactic distinction between dict and set expressions. This is my proposal, based on Elixir:

let isDict(%{..}) := true
let isDict(_) := false

assert(%{}.isDict())

This distinction would allow to generate struct-like dicts more comfortably:

let newStruct(val) :=
    let foo := x -> val + x
    let bar := x -> val * x
    %{ foo, bar } # would be the same as %{ "foo" => foo, "bar" => bar }

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