10000 Statement lambdas don't support "full statements"? · Issue #845 · evhub/coconut · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Statement lambdas don't support "full statements"? #845
Closed
@abra3607

Description

@abra3607

Hi,

Loving the language!

The docs on statement lambdas say that

statement can be an assignment statement or a keyword statement

and

Statement lambdas support full statements rather than just expressions and allow for the use of pattern-matching function definition

But I might be misunderstanding what that means exactly, since I'm getting syntax errors on any statement lambda that contains what Python's grammar defines as a compound statement, namely

compound_stmt:
    | function_def
    | if_stmt
    | class_def
    | with_stmt
    | for_stmt
    | try_stmt
    | while_stmt
    | match_stmt

So per docs something like this should work, but doesn't

def () => if True: pass

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0