I think a lot of these have existing analogues. To add to Veracity's examples:
Originally Posted by fronobulax
set contains obj
foreach obj in set
list contains obj
foreach obj in list
add / insert is the only one off the top of my head that would probably require special syntax (or a new function). Polymorphism could mean that we could even use append(aggregate, obj), although I think I'd prefer one of the names add / insert (preferably with the ability to specify index for lists, too).
I'm planning on working on it this (long holiday) weekend.
I pinged zarqon, asking for his contribution to the discussion, since non-backward-compatible versions of this directly affect his scripts.
Still hoping he responds, before I start spending time on it...
I quite appreciate your messaging me about this. Unfortunately I won't have time to formulate proper opinions and give a proper response until after the weekend (out of town gigs). Would be nice if it were a holiday weekend over here now as well!
I can say for now that I'd be happy to change the list-handling functions in ZLib to not use the word "list" as a variable. Those functions mainly enable functionality which it looks like this new feature will replace, so the new ASH feature may deprecate that section of ZLib anyway.
More on this after the weekend. Will endeavor to push an update to ZLib renaming the variables tonight.
Maybe it's too late to contribute anything to this discussion, so ignore this if the feature is already done.
Is there a reason to create a list type instead of just extending the functionality of arrays to act more like arraylists? From an end-programmer perspective, you can basically treat an arraylist and an array as identical concepts, except arraylist allows resizing. It seems much more elegant to add insert/remove functionality to arrays to make them more like arraylists than to introduce a whole new collection type. And as an added benefit, you don't break anyone's code who uses the word "list". What is the benefit to having two similar collection types when one is simply a superset of the functionality of the other?