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

[Bug] Unable to remove string values from list #238

Open
MerlinofMines opened this issue Apr 2, 2022 · 3 comments
Open

[Bug] Unable to remove string values from list #238

MerlinofMines opened this issue Apr 2, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@MerlinofMines
Copy link
Owner

Describe the bug
Currently it's not possible to remove string values from a list, as the string values are interpreted as keys vs values.

To Reproduce
set myList to ["one","two"]
myList -= ["one"]
print myList

Expected behavior
"one" value is removed from the list. Today it does nothing, as it looks for a "one" key, doesn't find it, and then returns the original llist.

Additional context
I think a major issue here is an inability to declare whether you are trying to operate on keys or on values. Additionally, it may be time to consider separating lists and dictionaries more strongly.

@MerlinofMines MerlinofMines added the bug Something isn't working label Apr 2, 2022
@MerlinofMines
Copy link
Owner Author

I think i like the idea of {} for dictionaries and [] for lists. This would be similar to python, though I think I like "->" as the key separator vs ":", which is already overloaded.

@jgersti
Copy link
Contributor

jgersti commented Apr 4, 2022

Sounds good and would remove atleast one of my problems when replacing the ListProcessor with a conventional rule.
One stumbling block might be the MultiListProcessor when someone wants to immediatly access a dict.

Print {"a" -> 0, "b" -> 1, "c" -> 2 }["b", "c"]
# should print "[0,1]"

@jgersti
Copy link
Contributor

jgersti commented Apr 19, 2022

I did start to implement a seperation of KeyedList into a dictionary and a list. While doing that i noticed that the actual expected/implemented behaviour is removal by index/key.

Print reverse (0...3) - 1
# [3,1,0]

To make the example given in the issue report work would necessitate a change of the current behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants