mplekunov / CalculatorApp

GNU General Public License v3.0
1 stars 0 forks source link

Editing in Expandable #26

Closed mplekunov closed 2 years ago

mplekunov commented 2 years ago

So... Editing of regular expressions is fairly easy... The problem began when we start thinking about functions... For Functions I will HAVE to use Images in my "input" that will represent those functions (like you can't write sqrt to represent square root symbol...). The problem is that so far I have been dealing with only ""strings"....

Solution (or at least an idea about one....): I think I can use ImageSpan.... So... I would need to use an ImageSpan when I'm dealing with functions, and StringSpan when I'm dealing with regular numbers... This should make it possible to implement editing mode...

Problem #2... Evaluation.... Like... I will need to find a way to implement an evaluation of those functions.... The problem lays in the fact that since functions are represented as images... I can't just "parse" them.... They are not strings.

Possible Solution: I can "possibly" represent functions as strings "internally" and represent them as "images" externally... So when I will pass an Expression as a collection of tokens, it will use those tokens to "evaluate" expression including functions... However when something externally will ask for that expression... I will give it "Formatted" expression that will include SpannableString with SpannableImages.... I guess...

mplekunov commented 2 years ago

Solved in #33