> On Aug 24, 2015, at 11:32 AM, John Carmack <jo...@oculus.com> wrote: > > The idea that you functionally compose images like this: > > (place-image image-1 x y > (place-image image-2 x y > (place-image image-3 x y))) > > Which draws image1 on top of image2 on top of image 3, which is backwards > from the "painters order" that would draw image 3, then image 2, then image 1. > > This imperative, side-effect-ing code is a little less clear to a beginner > with the OOP and DC concepts, but It better represents what actually happens, > and it is much easier to modify the code without worrying about the nesting. > > (send dc draw-bitmap imag3 x y) > (send dc draw-bitmap imag2 x y) > (send dc draw-bitmap imag1 x y)
Working with my children and first-year students I see this problem all the time; probably at least half of the kids I work with feel this way. After thinking about it a bit, though, I see that the fundamental problem here isn’t functional vs. imperative; it has to do with operator order. So, for instance, I claim that my students would be (relatively) happy if they got to write ((image3 place-image x y image2) place-image x y image1) I don’t have a good answer here—many people have tried to build infix syntax for Scheme & Racket, and none of them has yet caught on. Perhaps Alex Knauth’s macro is the right thing, but what’s really needed (it seems to me) is a solution with widespread acceptance. John -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.