
Hi Could anyone help me with the project I’m working on? The project is to implement linear image filters. Could you give some advice that could help me with the project? e.g. Is it OK to read image as bitmap, convert to color-list and work with the colors (pixels) or it is better to use flomap or something else?
P.S. I am new to racket

@marian.petruk Since a linear filter requires you to use the color values for neighbouring pixels, I think a list-of-lists representation of the data will be slow.

I think, flomaps will be better for your purpose.


module-top-level declarations?

Does (current-namespace) return a namespace containing an instantiation of the module?

Just thinking aloud: If the button callback only gets a reference to the UI object, is it possible to make anew drracket:frame that holds the information you need (so you can get it from the button)?

The repl has a get-user-eventspace

and a get-user-namespace


I’m probably being thick, but is there a way to influence the pretty-print depth that rackunit uses when printing test failures? I’ve tried adjusting pretty-print-depth in the test module, and even calling a failing test with (parameterize ([pretty-print-depth 50)) …), to no avail.

I am not certain whether or not this answer is right, but you might try adjusting error-print-width
, instead: https://docs.racket-lang.org/reference/exns.html#%28def._%28%28quote._~23~25kernel%29._error-print-width%29%29

that’s a good guess (thanks!), but that doesn’t seem to influence what I’m seeing

fwiw, I’m using check-equal? (It’s conceivable that other predicates do things differently. I seem to recall that check-match is really verbose when it reports a failure.)

also fwiw, I’ve trying to print a list whose members are transparent structs. there may be some setting having to do with structs that’s getting in my way

IME, RackUnit sets a lot of things up in a way that makes them very awkward to customize. But my bet is that if you want to change that particular piece of behavior, you’ll have to drop down to current-check-handler
. https://docs.racket-lang.org/rackunit/internals.html#%28def._%28%28lib._rackunit%2Fmain..rkt%29._current-check-handler%29%29

that sounds like a good place to dig in — thanks!

@alama Not exactly what you were asking, at least directly, but I’ve found https://docs.racket-lang.org/sexp-diff/index.html handy when a check-equal?
fails and actual vs. expected are (say) two large-ish x-expressions. Might help for list of transparent structs, too, idk.

@greg thanks!

turns out it was a boneheaded mistake of mine — I hadn’t consistently defined ALL the structs I’m working with as transparent (just some of them). d’oh.

(oops, I missed this discussion [Slack newb])

yeah, no 418 — you can do that yourself if you want some easter eggs in your Racket-powered web app ;->

@notjack makes sense — it seems pretty redundant to me in essentially all cases, though I can imagine apps that might respond differently to the same status code but different messages