uiua-lang/uiua

Suggestion: Format 2+adic custom modifiers using `‼` (double exclamation point)

Omnikar opened this issue · 3 comments

This was mentioned on the Discord server a while ago and I like the idea. You would be able to type a custom modifier name with normal exclamation points, and the formatter would handle converting Example!! -> Example‼. Even-adic modifiers would use half as many s, and odd-adic modifiers would use s followed by one !.

Hmm, it can look weird with an odd number.
image

I personally don't really mind how that looks. How common is it to have 3+adic modifiers anyway?

I'm not opposed.
I've looked into implementing this, and the main problem is that because formatted, non-formatted, and partially-formatted code all need to be equivalent, identifiers M!! and M‼ need to compare equivalent.
This would require the creation of a custom identifier type that compares well and a refactoring of some of the code that refers to them.
It could be done, though it's bit of work.