<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi Julien,<div><br></div><div>In my original post there is this line of code:</div><div><br></div><div><span style="font-family: Edlo;"> % set_hit(), Target is not mutable here...have another think!</span></div><div><font face="Edlo"><br></font></div><div><font face=".SF NS">I initially thought that I would indeed set the hit flags on the targets at the time the collision detection code said something was hit. I do indeed already have an earlier version that does this, obviating the needs for the sets at all, but for some reason I decided to do some experiments to see where it would lead.</font></div><div><font face=".SF NS"><br></font></div><div><font face=".SF NS">Since my question, I have now seen a nice cartesian solution I didn't know about, and decided to reinstate my initial, what I thought could have been fancier solution, and just call the set_hit() function on the object(s)...this of course means that the output from the collision detector is just updated lists of input objects, meaning, yes, I don't need any of the ID sets blah blah blah.</font></div><div><font face=".SF NS"><br></font></div><div><font face=".SF NS">Sometimes you just have to tinker to see what the options are and what benefits they may/may not have.</font></div><div><font face=".SF NS"><br></font></div><div><font face=".SF NS">Thanks all,</font></div><div><font face=".SF NS">Me.</font></div><div><font face="Edlo"><br id="lineBreakAtBeginningOfMessage"></font><div><br><blockquote type="cite"><div>On 10 Oct 2023, at 07:09, Julien Fischer <jfischer@opturion.com> wrote:</div><br class="Apple-interchange-newline"><div><div><br>On Mon, 9 Oct 2023, Sean Charles (emacstheviking) wrote:<br><br><blockquote type="cite">The output is two lists, the object IDs of those things involved in collisions.<br>My question then is, given the two loops are basically generating a<br>cartesian product, is there a module function somewhere that would do<br>that for me, generate a single list of all pairs? Then I could<br>list.chunk and maybe produce a cleaner bit of code. I am currently<br>also considering on uncommenting out the set_hit() typeclass predicate<br>so that I can modify the objects in place, so instead of returning two<br>sets of objects ID,s I'd be returning a new set of objects with their<br>respective hit flags set.<br></blockquote><br>My questions are: what do you do with those object ids once you have<br>them? And could you do whatever that is inside the loop that generates<br>the Cartesian product without building up a list or set containing the<br>product?<br><br>Julien.<br></div></div></blockquote></div><br></div></body></html>