mirror of
https://github.com/ArnoldSmith86/virtualtabletop.git
synced 2026-03-02 22:57:02 -05:00
Routines need to be able to manipulate strings of numerals #275
Labels
No labels
PCIO compatibility
Validator
automated testing
bug
documentation
duplicate
editor
enhancement
enhancement
library
library
maintenance
needs legacy server
pile related
reported client crash
routine operations
user interface
widget properties
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/virtualtabletop#275
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @robartsd on GitHub (Jun 13, 2021).
Originally assigned to: @robartsd on GitHub.
Currently computations ALWAYS interpret strings of numerals as numbers. There needs to be ways to explicitly work with them as strings.
@robartsd commented on GitHub (Jun 14, 2021):
An automatically generated
idhappened to be all numerals. 'idplaced in array by a routine and stored incardsPlayed` property. Stored property contained number instead of string. This select fails to capture the card.@robartsd commented on GitHub (Jun 14, 2021):
I think the toNum conversion should be moved to be operation sensitive:
Should not convert to number:
+(unless both operands can be converted)@ArnoldSmith86 commented on GitHub (Jun 14, 2021):
Changing that will be really ugly. The fileupdater would have to add it before nearly every operation...
@robartsd commented on GitHub (Jun 14, 2021):
It needs to be fixed even if it breaks things.
@ArnoldSmith86 commented on GitHub (Jun 14, 2021):
I don't agree. It should be fixed (or added) but we shouldn't break things.
@robartsd commented on GitHub (Jun 14, 2021):
It needs to be fixed. If it can be fixed without breaking things that is great. If it can't be fixed without breaking things, then things break.
@robartsd commented on GitHub (Jun 14, 2021):
A possible fix that would not break things would be to add some way to switch mode between converting strings to numbers or not (defaulting to current behavior or using fileUpdater to override the new default).
This could be a new Boolean property in "func" blocks and a keyword on the LHS of dynamic expressions.
@ArnoldSmith86 commented on GitHub (Jun 14, 2021):
I mean, sure. But it can 100% be done without breaking stuff. The easiest solution would be to have a whole different set of operations.
A mode switch is already 100x better and maybe we find an even better solution.
@robartsd commented on GitHub (Jun 14, 2021):
I'd be okay if a mode switch turns off conversion to numbers completely, but I'd prefer conversion to number continue regardless of mode switch anywhere only a number would make sense.
Fortunately conversion from number to string happens automatically in many cases.
@robartsd commented on GitHub (Jun 14, 2021):
Mode switch in Dynamic Expressions will be a small pain to write, simply because many (if not all) of the capturing indexes will change. Too bad named capture groups are probably not well enough supported for us to simply go with named capture groups as a more maintainable solution.
@ArnoldSmith86 commented on GitHub (Jun 14, 2021):
Yeah. I think we should list all the functions that would need a toggle (or always disabled). Then we add a mode toggle that defaults to "no conversion for those functions" and implement a fileupdater that adds the toggle at the start of every routine that uses one of those functions.
@robartsd commented on GitHub (Jun 14, 2021):
Would we toggle at the routine level or the routine step level? At first I was thinking a flag in every step, but a step that changes the options might be nicer.
@robartsd commented on GitHub (Jun 14, 2021):
We discussed in our meeting today about adding a mode switch to routines. To accommodate future changes we want a format that allows setting multiple modes in one line.
Another mode we mentioned would be for legacy setting default values of operands to
1.