Skip to content

Conversation

@ajay-mk
Copy link
Member

@ajay-mk ajay-mk commented Dec 11, 2025

Further extension of #450: adds operator overloads for Variable, similar to the existing pattern for Constant.

@ajay-mk ajay-mk requested a review from evaleev December 11, 2025 03:39
Copy link
Collaborator

@Krzmbrzl Krzmbrzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could take the chance and extend Variable's ctor such that it can be constructed from a regular (UTF-8) string and then extend the test cases to include a version that uses an arithmetic operator with a UTF-8 string

@bimalgaudel
Copy link
Member

bimalgaudel commented Dec 11, 2025

User defined literals seem a match made in heaven for this feature. Binary operation between plain strings and expression objects sounds a little risky to me.

Update: meant string literals user defined literals

@ajay-mk ajay-mk force-pushed the ajay/feature/arithmetic-ops-with-variables branch from 8fc2cdb to b13233f Compare December 12, 2025 05:57
@ajay-mk
Copy link
Member Author

ajay-mk commented Dec 12, 2025

The aim is to build expressions where the code reads like the equations. A user-defined literal would get in the way of that. For example, for $\omega t_{2}$ we want to write "ω" * T_(2). Using "ω"_v * T_(2) feels less natural.

@ajay-mk
Copy link
Member Author

ajay-mk commented Dec 15, 2025

Is this okay to merge?

ajay-mk added a commit that referenced this pull request Dec 15, 2025
@ajay-mk ajay-mk merged commit 3baa89c into master Dec 16, 2025
16 checks passed
@ajay-mk ajay-mk deleted the ajay/feature/arithmetic-ops-with-variables branch December 16, 2025 14:45
ajay-mk added a commit that referenced this pull request Dec 16, 2025
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

Successfully merging this pull request may close these issues.

4 participants