mflatt
2017-4-13 12:18:18

@leif The idea looks fine to me


leif
2017-4-13 12:19:01

@mflatt Okay cool, thanks.


leif
2017-4-13 12:19:13

I also added a check for a base of 1


samth
2017-4-13 16:28:21

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


samth
2017-4-13 16:28:41

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


samth
2017-4-13 16:28:42

samth
2017-4-13 16:29:09

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


samth
2017-4-13 16:29:29

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


mflatt
2017-4-13 16:32:55

@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


samth
2017-4-13 16:38:16

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


recon419
2017-4-14 00:29:12

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)?


recon419
2017-4-14 00:33:48

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


andreiformiga
2017-4-14 01:05:03

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


andreiformiga
2017-4-14 01:05:42

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


asumu
2017-4-14 03:33:26

@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)


asumu
2017-4-14 03:35:08

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/