ID:2472728
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.

The ability to overload the "in" operator to allow for the full recreation of a list datum/structure.


List/proc/operatorin()
Yes please. If there's an operator it should be overrideable.
It would definitely be nice to have in theory, but how would it work in practice? BYOND doesn't have iterators, so what would it return? A list?

EDIT: Oh right, the actual operator use of it
Yeah, that one would be pretty easy to figure out
It wouldn't be a full recreation without both uses of it though
Why not have operatorin() and operatoriter()?
Yeah, but how would the latter work?
We want this:
a in b // "is a in b?"
// calls b.operator???(a) which returns a bool

for(a in b) // "for each a in b:"
// calls b.operator???() which returns a list

With these, we can make our own lists and use them the same exact way.

Login to reply.