Having an "in" operator for ListSource Class #2599
Replies: 1 comment 2 replies
-
To be completely honest: I was a little surprised that The complication is the handling of equality on rows. ListSource requires that This is why |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I was utilizing two distinct table objects with the aim of transferring a value from one list to another, ensuring that the second list contained only unique values.
My approach involved using the
in
operator onListSource().data
(Can not use on table itself becauseTable
does not inherit from Iterator) to verify if the data already existed in the list before adding it. Below is the code for a clearer understanding.The approach is ineffective because
table2.data
is merely a list of row objects, and checking each row object will always return false unless the checked object is a reference to one of the objects withintable2.data
. Wouldn't it be more practical to modify thein
operator to verify the values within the rows rather than the row objects themselves? (The append function already accepts values rather than row objects; the API would remain consistent with this method as well.)Beta Was this translation helpful? Give feedback.
All reactions