You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there isn't a way to define a negative value.
The easiest way to approach this would be to create new variable types that are "negative" versions of existing or future data types (int -> -int, float -> -float), but that would mean consuming slots of variable types, which is maxed out at 9 (unless we want to enforce 2-digit parsing for complex data types in the future). It would also mean some potentially weird handling of those variables. For example, we wouldn't want to write separate cases for how to handle += of a negative vs positive integer.
Another approach would be to add another public element to Y2KVar that would toggle negative/positive for that variable. I'm reluctant to do that though, since that value wouldn't really make sense for string types, so it would be a wasted cycle.
I'm open to suggestion on how to implement this.
The text was updated successfully, but these errors were encountered:
Currently there isn't a way to define a negative value.
The easiest way to approach this would be to create new variable types that are "negative" versions of existing or future data types (
int
->-int
,float
->-float
), but that would mean consuming slots of variable types, which is maxed out at 9 (unless we want to enforce 2-digit parsing for complex data types in the future). It would also mean some potentially weird handling of those variables. For example, we wouldn't want to write separate cases for how to handle+=
of a negative vs positive integer.Another approach would be to add another public element to
Y2KVar
that would toggle negative/positive for that variable. I'm reluctant to do that though, since that value wouldn't really make sense forstring
types, so it would be a wasted cycle.I'm open to suggestion on how to implement this.
The text was updated successfully, but these errors were encountered: