nm i found a cool hack that /also/ does cartwheels with lifetimes
-
-
no this still won't do it. i'm losing my fucking mind. this is day 4, half that time has been squabbling with lifetimes AGAIN, and this code has not once compiled
1 reply 0 retweets 0 likesShow this thread -
i don't have time for this either, i've got stuff to do that can't really wait on indefinite port of only a thousand lines of code that's only even step 1 to getting anywhere near the thing i actually wanted to fucking do
2 replies 0 retweets 0 likesShow this thread -
i guess the only thing i can think to do is bubble up all the mutation somehow so it only happens in one place. and hope i don't fuck up the algorithm any more than i already have since i haven't been able to run this a single time lol
2 replies 0 retweets 0 likesShow this thread -
alternatively, now that i've read the source code In Great Detail, i could throw all this away and read the paper over again and try to implement it from scratch
2 replies 0 retweets 12 likesShow this thread -
so this is an extended sweep line algorithm, and the wrinkle i'm hitting is that when the sweep line finds an intersection, it splits the existing segments by ⓐ mutating the existing segment and ⓑ adding a new segment to the list. this happens a couple method calls down
1 reply 0 retweets 2 likesShow this thread -
adding a new segment to the list requires mutable access to the entire list of all segments, which rust doesn't like because in principle it means you /might/ invalidate that whole list while holding references in the caller
3 replies 0 retweets 0 likesShow this thread -
it seems like the obvious workaround is for the "split" to not /actually/ mutate, but to pass split points back up into the main loop, which should then be able to be the sole owner of the list and mutate it with wild abandon?
2 replies 0 retweets 0 likesShow this thread -
except of course there's still the case of "what if the vec reallocates" so i would still need the arena, i guess...
4 replies 0 retweets 0 likesShow this thread -
current state of this: it compiles, it runs, it gets stuck in an infinite loop
3 replies 0 retweets 10 likesShow this thread
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.