Skip to content

Spec. for anonymous functions with by-value parameters is not implemented #241

Open
@scabug

Description

@scabug

In the specification, a function type with by-value paramters is defined as such:

Type ::= ‘(’ [‘=>Type] ‘)’ ‘=>Type
       | ...

In practice, the compiler accepts types such as:

(=>int, =>int) => int

It is a bit tricky to have the specification fit the implementation properly because the grammar for a non-by-value parameter list is part of SimpleType (and shares a production with tuple types):

SimpleType ::= ‘(’ Types [‘,’] ’)’
            | ...

Wich means the by-value marker => cannot be added there.

It isn't pretty, but the rule for Type may be changed to:

Type ::= ‘(’ [‘=>Type {‘,’ [‘=>’] Type}] ‘)’ ‘=>Type
       | ...

This issue is a sub-element of #233.

This issue is related to #238.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions