Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from type Pattern to matching Pattern #5

Closed
c3d opened this issue Feb 7, 2020 · 0 comments
Closed

Switch from type Pattern to matching Pattern #5

c3d opened this issue Feb 7, 2020 · 0 comments

Comments

@c3d
Copy link
Owner

c3d commented Feb 7, 2020

The documentation used to refer to a pattern-based type definition using the type Pattern notation. For example, complex would be defined as

complex is type complex (Re:real, Im:real)

This notation is a bit confusing since it does not explain why something is a type. Also, I would like to be able to use type (Expression) to return the type of an expression (although that might be typeof)

The documentation now uses matching for that usage. With syntactic sugar, the recommended way to describe the complex type above would now be:

type complex is matching complex(Re:real, Im:real)

The interpreter and compiler should be updated to match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant