Of course I could write a proper replacement, but that's not the point. It's better if the language comes with a proper list type that everyone uses. But as is, the list type in Max is worthless for most stuff.
Hell they didn't even get the compare method stuff right. You were originally supposed to sort lists by writing a new compare method, but then I found out that when you do that it messes up other list commands which you wouldn't think use it, but do. I think FindLink was one of those which is affected. It expects Compare to compare the link pointers, (or maybe it was object pointers) but obviously sorting a list by pointers is totally useless. So if you change the compare function so sort sorts by something sensible, like Order, then you screw up the other list commands. So what did they do? Instead of fixing the commands that shouldn't use Compare, they tacked a new compare function parameter onto the Sort function so you can pass a custom compare function to it. Allowing multiple compare functions is a good idea, granted, but it's still a kludge, and leaves buggy code in.
Hell they didn't even get the compare method stuff right. You were originally supposed to sort lists by writing a new compare method, but then I found out that when you do that it messes up other list commands which you wouldn't think use it, but do. I think FindLink was one of those which is affected. It expects Compare to compare the link pointers, (or maybe it was object pointers) but obviously sorting a list by pointers is totally useless. So if you change the compare function so sort sorts by something sensible, like Order, then you screw up the other list commands. So what did they do? Instead of fixing the commands that shouldn't use Compare, they tacked a new compare function parameter onto the Sort function so you can pass a custom compare function to it. Allowing multiple compare functions is a good idea, granted, but it's still a kludge, and leaves buggy code in.