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

Text cells beginning with "=" cannot be created #21

Open
aschmolck opened this issue Oct 14, 2021 · 0 comments
Open

Text cells beginning with "=" cannot be created #21

aschmolck opened this issue Oct 14, 2021 · 0 comments

Comments

@aschmolck
Copy link
Contributor

As far as I can tell, there is currently no way to create a string CellValue that starts with "=" via the API, because such cells will always be interpreted as formulas. A more robust api would be requiring some explicit constructor or function call for formulas, rather than overloading strings for both text content and formulas.

For example,

row!["=A1+B1", "A1+B1"]

could become

row!["A1+B1", formula("A1 + B1") ]

The downside of this, is of course that it would be a breaking API change.

An alternative might be to keep the !row macro working as now, and just change the Row::add_cell API to always treat String as String and add a Formula type, or even to keep that API as well, but add a new function like Row::add_cell_strict. If necessary the row! macro could grow some tag to explicitly disambiguate strings (potentially) starting with "=".

Assuming the above is not mistaken I'd be happy to work on a PR that implements one of these strategies.

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

No branches or pull requests

1 participant