Skip to content

Lua-like no parentheses call #372

@giann

Description

@giann

In lua if a function call has only one argument and it's a string or a table, parentheses can be omitted like this:

callMe "John"
join { 1, 2, 3 }

We could imagine something similar for buzz on literals only (not a named variable, named object init or enum case which would make the grammar too ambiguous):

// string
callMe "John"
// list
join [1,2,3]
// map
sum { "one": 1, "two": 2, "three": 3 }
// anonymouse object
send .{ data = "some payload" }
// pattern
match $"[a-z]+"

This would make writing configuration files in buzz or any other declarative thing easy/elegant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    languageIssue related to the languageproposalSomething we consider doing

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions