Skip to content

Move dots.h to .h.b to give precedence to .h.c#146

Open
knuesel wants to merge 1 commit intotypst:mainfrom
knuesel:fix-dots-precedence
Open

Move dots.h to .h.b to give precedence to .h.c#146
knuesel wants to merge 1 commit intotypst:mainfrom
knuesel:fix-dots-precedence

Conversation

@knuesel
Copy link
Collaborator

@knuesel knuesel commented Feb 25, 2026

It seems that having dots default to the centered version was meant to be implemented already in typst/typst#747 but that implementation was wrong (just changing the order of .h and .h.c without considering the number of modifiers).

Closes #147

@MDLC01 MDLC01 added breaking This involves a breaking change waiting on reviews Breaking and non-breaking changes need respectively 3 and 2 reviews labels Feb 25, 2026
@MDLC01
Copy link
Collaborator

MDLC01 commented Feb 25, 2026

Since I expect dots to be commonly used in math, I would suggest the following path that ensures a smooth transition:

  • In the next version (i.e., this PR), introduce dots.h.b and deprecate dots.h, suggesting to use dots.h.b instead.
  • In a future version, change dots.h to be the centered version and deprecate dots.h.c, suggesting to use dots.h instead.
  • In a later version, completely remove dots.h.c.

That way, we ultimately end up with dots.h and dots.h.b and no dots.h.c.

Unrelatedly, I don't love the .b modifier here, but I don't have a better solution so it's probably fine. An alternative is to rename the current dots.h to ellipsis, but I think this is just confusing.

@knuesel
Copy link
Collaborator Author

knuesel commented Feb 25, 2026

Good idea. It wasn't clear to me this deprecation was possible but l guess there's no problem if we have two different lines for the same symbol.

I have the same feeling for .b. Another option would be to use dots.op for dots.h.c and dots.basic for dots.h.b. This would mirror the relationship between dot.op and dot.basic.

@dccsillag
Copy link
Collaborator

dccsillag commented Feb 25, 2026

I think the deprecation plan is good.

Re. names, I also share the slight discomfort with .b, but I think it is better than ellipsis (because then it's less discoverable) as well as dots.op/dots.basic (dots.basic is a bit weird but not too bad, but dots.op is not an operator like dot.op is). Overall, I don't think it's that bad of a choice, especially considering it's just a "transition name".

@knuesel
Copy link
Collaborator Author

knuesel commented Feb 25, 2026

dots.op is not an operator like dot.op is

dots.op (U+22EF) has the "relation" class, so it's arguably considered an operator in Unicode in the same sense as > (unlike dots.b which has normal class) though it's indeed different from a binary operator like dot.op...

@MDLC01
Copy link
Collaborator

MDLC01 commented Feb 25, 2026

Overall, I don't think it's that bad of a choice, especially considering it's just a "transition name".

dots.h.b would not be a transition name though.

@T0mstone
Copy link
Collaborator

How about dots.h.low? We already have precedent for .low with ast.low (⁎) and quote.low.

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

Labels

breaking This involves a breaking change waiting on reviews Breaking and non-breaking changes need respectively 3 and 2 reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically centre dots between infix notation

4 participants