Skip to content

finalize static and delay syntax #38

@dylex

Description

@dylex

The "delay" "keyword" only really needs to appear is types (and possibly patterns for lambda) and currently looks like function application, so is unambiguous there. In practice, there is little reason to use it in patterns, so limiting to types seems reasonable.

"static" however, appears in types similarly, but also needs to apply to let, case, and possibly lambdas. (Currently we really do treat it as a keyword in "let static", which is a hack.) One option is to allow it in patterns in general, and infer from them (let static x = ..., case x of static _ ..., static x -> ...). Another is to use special keywords. The fact that case has multiple patterns and looks strange argues for the latter. I would prefer a pre- or post-symbol, something like _let or case# or even #->. This scheme could also allow user functions like if_ to be defined following a similar pattern.

Originally I wanted "delay" and "static" to be handled the same way, general enough even to support other macro-like "transforms", but I no longer think that's a good idea, as they're quite different. As a side note, backtick is the only character not (yet) parsed as anything (infix in haskell).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions