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

Added ability to define operation aliases in block form #129

Merged
merged 4 commits into from
Mar 11, 2020
Merged

Added ability to define operation aliases in block form #129

merged 4 commits into from
Mar 11, 2020

Conversation

mehalter
Copy link
Member

Added a second notation for @op macro inside of the @theory

@op begin
  Hom :→
  compose :⋅
end

Also updated tests to make sure both notations work, and found a typo/bug in one of the ParseError definitions

@jpfairbanks
Copy link
Member

Cool! What about doing the syntax like

@op begin
  (→) := Hom
  (⋅) := compose
end

That makes more sense from a math notation perspective.

@mehalter
Copy link
Member Author

I just made a change that will currently allow you to define them in the notation that James brought up, or the same notation that is used for the single line definitions. Once we decide on a specific version to use, I can remove the other in the if statement. We can agree to use both, but I think I would prefer to settle on a single notation.

@epatters
Copy link
Member

I would also strongly prefer to settle on a single notation. I think I slightly prefer James' notation, but here I don't feel as strongly.

@jpfairbanks
Copy link
Member

Yeah I think the Hom :+ is ooogly. let's just do the := notation. and then we just forbid using := as a unicode name for a Gat term.

@mehalter
Copy link
Member Author

Cool I think this PR is ready once the tests pass.

@epatters
Copy link
Member

For consistency, shouldn't we use the same syntax in the short form of @op, e.g., @op (→) := Hom instead of @op Hom :→?

@jpfairbanks
Copy link
Member

Yeah I think that is more consistent

@epatters epatters merged commit c265e17 into AlgebraicJulia:master Mar 11, 2020
@mehalter mehalter deleted the aliases branch March 11, 2020 01:47
@jpfairbanks
Copy link
Member

New code looks good to me. I like this interface a lot

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

Successfully merging this pull request may close these issues.

3 participants