
@leif The idea looks fine to me

@mflatt Okay cool, thanks.

I also added a check for a base of 1

I think there was a mailing list discussion a while back about macros that stash identifiers on the side and then pull them out later

And this is an issue that I’ve been running into as well — the essence is here: https://gist.github.com/samth/e1770211d010afa547825e600f7f0279


which includes a work-around, but I’d like something that doesn’t require the extra indirection/expansion step

Does anyone remember this? (perhaps @mflatt or @lexi.lambda)

@samth I don’t see a way to skip the extra step; you need i
to be in the body of the lambda
when it is expanded, which is when the binding scope for i
is created

Ok, that makes sense but is too bad in my case

Hey all, I’m relatively new to Racket and am trying to figure out if it would be good for the project I want to do. I’m looking to create a procedural map generator for tabletop RPG maps, using an existing tile set that a human game master would normally use to create dungeons. I know Racket is capable of displaying images and overlaying them and stuff like that (although I’m a little fuzzy on the details), but I’d also like to eventually be able to apply some photo-manipulation techniques such as color rebalancing, texture overlays, and lighting effects. I’m curious whether Racket has any of those sort of “GIMP-like” features, and a quick Google search doesn’t bring anything up relating to image processing in Racket.
The alternative at this point would seem to be writing a plugin for GIMP, but as far as I can tell GIMP wants you to write plugins in C, with potentially a really outdated Py2.6 implementation that I’m almost certain is entirely unsupported and unmaintained. I would much prefer a more modern Lisp like Racket if that’s an option, so I guess what I’m asking is: does Racket have good image manipulation libraries, and if so, what are they (link to docs)?

Alternatively, is there a way I could cleanly interface Racket with GIMP?

I can’t seem to find any image processing libs in the package catalog

I think the simplest possibility, if enough for your application, would be to use imagemagick

@recon419 as @andreiformiga said, imagemagick may be a good start. If you need some code for that, the ffi/examples
collection has some imagemagick FFI code: https://github.com/racket/racket/blob/master/pkgs/racket-doc/ffi/examples/magick.rkt (I don’t know how complete it is)

You could also see if racket/draw
provides enough of a graphics API to implement some of those operations (it exposes a cairo-like API): https://docs.racket-lang.org/draw/