Thanks to visit codestin.com
Credit goes to github.com

Skip to content

addpattern def with no prior match def #718

@yggdr

Description

@yggdr

I recently got back into coconut, and I like the improvements and additions. It is now possible to use the addpattern def syntax to add additional pattern matching functions with the same name. Unfortunately, with addpattern def func being merely sugar for @addpattern(func) right now, this means that whatever is the first function cannot use the addpattern def syntax, it has to use match def. So when refactoring one has to keep that in mind.

Now I understand how that developed historically, but I think it would be worthwhile thinking about unifying the syntax here, so that either addpattern def also works in the first instance, or match def incorporates the @addpattern(func) functionality on subsequent function definitions.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions