Genie Discord forum

Author Avataritsdfish
3/30/2023, 9:41:04 AM

Hi all,

I have a question about debugging with the GenieBuilder. Typically, I use print statements to look at output near an error. However, this does not work in the @handlers block. For example,

@handlers begin
  println("hello")
end

Does not print to the REPL. Is there a recommended workflow for debugging?

Author AvatarPere
3/30/2023, 1:44:32 PM

This is because the @handlersmacro doesn't actually execute code in the normal sense. It takes the reactive variables (@in,@out) and reactive code (@onchange) and exposes it to the UI.

If you need to debug, try placing the print statements inside an @onchange block

Author Avataritsdfish
3/30/2023, 2:03:43 PM

Thanks that works. I guess the limitation is that print statements are limited to the @onchange block. Fortunately, that is where most of the bugs are likely to occur.