-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] Simplification #8
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
Conversation
|
@Happypig375 is AliasMap related to MathAtom? |
|
It's related to LaTeX-MathAtom two-way conversion. |
What's the reason for this change?
Dictionary: Key->Value
Struct DUs occupy 4 bytes. Enums occupy 4 bytes. Why lose type safety here?
MathUnit := FontSizeInPoints / 18
From CSharpMath. I didn't look into what this does. Also, the change from Brackets as DUs also lose the ability to have user-defined delimiters. Moreover, the change from the DataTypes folder to MathAtom loses the meaning of sharing types between MathAtom and TextAtom implementation. I'd also like to reverse this change. |
|
Rest looks good. |
Interesting. My intention was to remove the mutable/immutable scaffolding which isn't necessary, and I thought that was all there was so I removed everything. Can we do this with plain Dictionaries? It will be much simpler without pretending to be immutable. I remember you did a BiDictionary for CSharpMath.
Enums are more primitive objects and don't lose type safety (just disable FS0104 dotnet/fsharp#4522). But this change is not a big deal and I don't mind reverting it.
Interesting. With the current SpaceType then, if you double the font size, some display sizes will double and others won't (Spacing when SpaceType is in points). Do we want this flexibility, or do we want the guarantee that when you double the font size, the display size doubles? I am somewhat in favour of keeping the guarantee and reducing flexibility.
Do we need these code points? Is there any place in the current code where char is inadequate? We may need other unicode code points inside the Text case but that is
Do more than 0.01% of LaTeX users define their own delimiters? User-defined delimiters would increase complexity and reduce type safety by more than 0.01% so I am not in favour!
OK I can revert but there is not much in here yet and most will get moved elsewhere later. |
Sounds good.
Aside from being immutable, it also helps me practise functional programming. 😉
Struct DUs also offer more useful methods such as IsX where X is an enum case.
Only spacing commands that take units as input can create non-mathunit spaces. Only if the user wants it will it be created.
I guess we might have to wait and see. Not reversing for now.
I don't have the stats but I saw at lease one issue on this in wpf-math: ForNeVeR/xaml-math#160
Ok |
|
** I have the basic completed AliasMap implementation in latest commit, please don't duplicate the work! |
|
I'm going to merge this in a few hours from now. |
|
Just curious, why there are two separate types for brackets? ( |
|
@FoggyFinder I couldn't decide. You are probably right that one type is better. ( |
|
I also had to revert |
|
For brackets that need balancing, |
Glad that you have made a start here @Happypig375
This PR:
I am unsure of:
SpaceType, how is the ratio between a MathUnit and a point determined? It would be good to simplify this type in some way but it's not clear to me if it is fundamentally a float or a 2D float vector.