Page 118 of 118

Re: Scripters cove

Posted: Fri Oct 25, 2024 9:05 pm
by hiran
Whohoo! Another finding!

There is a way to retrieve a sorted dictionary already! Dictionary? Sorted? Well, that's what it seems to be...
https://github.com/OoliteProject/oolite ... y.m#L12854

I would so much like to see a unit test that verifies the list is sorted. To be run on all the operating systems we compile on.

Re: Scripters cove

Posted: Fri Oct 25, 2024 9:08 pm
by Wildeblood
hiran wrote: Fri Oct 25, 2024 8:39 pm
Could it be that a dictionary internally ends up to be a hashmap and therefore the sequence is not predictable? Could we change this to some container that preserves a sequence? As soon as it does, sorting can be applied...
I think you're barking up a dead tree, hiran. If world scripts were sorted into a consistent, predictable order what good would result? I'd predict a lot of scripts named "AAA my script", etc.

Re: Scripters cove

Posted: Fri Oct 25, 2024 9:17 pm
by hiran
Wildeblood wrote: Fri Oct 25, 2024 9:08 pm
hiran wrote: Fri Oct 25, 2024 8:39 pm
Could it be that a dictionary internally ends up to be a hashmap and therefore the sequence is not predictable? Could we change this to some container that preserves a sequence? As soon as it does, sorting can be applied...
I think you're barking up a dead tree, hiran. If world scripts were sorted into a consistent, predictable order what good would result? I'd predict a lot of scripts named "AAA my script", etc.
The use case was made some posts above in this thread. I see that case legit.
What would you suggest to get around that in a meaningful way?

Be aware your example assumes everybody wants to be first. But then you forget the authors that do not care, and the authors that just want to be before a specific script but by no means the first. If all this imposes problems we can still come up with rules. Currently there is no consistent sorting so the scripts live in kind of anarchy.