lexi-lambda changed the topic of #racket to: Racket v7.2 has been released: https://blog.racket-lang.org/2019/01/racket-v7-2.html -- Racket -- https://racket-lang.org -- https://pkgs.racket-lang.org -- Paste at http://pasterack.org
DGASAU has joined #racket
dddddd has quit [Ping timeout: 246 seconds]
Sgeo_ has joined #racket
Fare has quit [Ping timeout: 255 seconds]
Sgeo__ has quit [Ping timeout: 255 seconds]
Sgeo__ has joined #racket
dddddd has joined #racket
Sgeo_ has quit [Ping timeout: 255 seconds]
pera has quit [Ping timeout: 245 seconds]
assertionerror has joined #racket
<assertionerror> Good evening everyone!
<assertionerror> Hi, everyone. I'm trying to figure if it is possible to test a function by mocking an internal binding. For instance, lets say I have a function called (define (f x) (g x)), would it be possible to replace 'g' by some mock function?
Fare has joined #racket
<bremner> what do you mean by an "internal binding"?
<assertionerror> In (define (f x) (g x)) function g is an internal (bound) binding of function f.
<dyl> Naive take: (define (_f g x) (g x)), then (define (f x) (_f g x)) :p
<assertionerror> Let's assume these are both defined as top-level functions of the same module. Maybe the question could be: is it possible to replace 'g' by some other function dynamically?
Fare has quit [Ping timeout: 252 seconds]
<dyl> The usual answer to "how can I make this easier to test" is "use more dependency inversion".
<assertionerror> Right.
<dyl> Is replacing g dynamically really what you want though? It's cute, but it's also fragile.
<assertionerror> The problem is that in this case, I have no control over f. It's 3rd-party code. And I simply want to patch the existing 'g' by my my own function 'g'.
<dyl> Off the top of my head, you could define a custom eval function to use when loading their code into your test harness.
<dyl> Such that when it sees (define (g ...) ...) it slips in its own form instead.
<dyl> (warning: here be dragons)
<assertionerror> I see. Maybe it's my best bet. But apparently there's no obvious way of doing this via module magic, right?
<dyl> This might also be relevant
<dyl> https://docs.racket-lang.org/reference/chaperones.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._impersonate-procedure%29%29
ng0 has quit [Quit: Alexa, when is the end of world?]
`micro has quit [Ping timeout: 250 seconds]
`micro has joined #racket
<assertionerror> Thanks, dyl! That looks interesting.
<assertionerror> Thanks for the brainstorm.
<assertionerror> Maybe https://docs.racket-lang.org/guide/module-set.html compile-enforce-module-constants could work. I'll try both ideas.
eddof13 has quit [Ping timeout: 246 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
Fare has joined #racket
assertionerror has quit [Quit: assertionerror]
catonano_ has joined #racket
catonano has quit [Ping timeout: 245 seconds]
catonano_ is now known as catonano
pera has joined #racket
dddddd has quit [Remote host closed the connection]
pie__ has quit [Ping timeout: 252 seconds]
Fare has quit [Ping timeout: 246 seconds]
Arcaelyx has quit [Quit: Textual IRC Client: www.textualapp.com]
jao has quit [Ping timeout: 252 seconds]
efm has joined #racket
jao has joined #racket
efm has quit [Ping timeout: 246 seconds]
notzmv has joined #racket
jao has quit [Ping timeout: 250 seconds]
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
Fare has joined #racket
ubLIX has quit [Quit: ubLIX]
Sgeo_ has joined #racket
Sgeo__ has quit [Ping timeout: 246 seconds]
sauvin has joined #racket
_apg has joined #racket
endformationage has quit [Quit: WeeChat 2.3]
ZombieChicken has joined #racket
pera has quit [Ping timeout: 272 seconds]
zmt00 has joined #racket
zmt01 has quit [Ping timeout: 252 seconds]
Fare has quit [Ping timeout: 246 seconds]
Fare has joined #racket
<ZombieChicken> I'm getting a weird error when trying to run a little program. "...irc-client.rkt:11:3: irc-connect: unbound identifier"
<ZombieChicken> " in: irc-connect"
<ZombieChicken> I'm using the irc lib, and I am requiring it at the start of the file. Not sure what's going on
<ZombieChicken> I am trying to use scribble/lp, for what that might be worth
<ZombieChicken> nvm. Figured it out. Apparently @(require... needs more parens than I was using
Fare has quit [Ping timeout: 245 seconds]
ZombieChicken has quit [Ping timeout: 256 seconds]
buyfn has joined #racket
buyfn has quit [Quit: buyfn]
Falacer has joined #racket
bor0 has joined #racket
selimcan has joined #racket
ng0 has joined #racket
pie__ has joined #racket
emacsomancer has quit [Read error: Connection reset by peer]
dddddd has joined #racket
vraid has joined #racket
orivej has joined #racket
YuGiOhJCJ has joined #racket
bor0 has quit [Ping timeout: 252 seconds]
jao has joined #racket
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
amz3 has joined #racket
vraid has quit [Ping timeout: 268 seconds]
ubLIX has joined #racket
notzmv has quit [Ping timeout: 246 seconds]
vraid has joined #racket
jao has quit [Ping timeout: 250 seconds]
badkins_ is now known as badkins
buyfn has joined #racket
pera has joined #racket
Sgeo__ has joined #racket
Sgeo_ has quit [Ping timeout: 246 seconds]
buyfn has quit [Quit: buyfn]
widp_ has quit [Ping timeout: 246 seconds]
widp_ has joined #racket
efm has joined #racket
endformationage has joined #racket
widp_ has quit [Ping timeout: 246 seconds]
trafaret1 has joined #racket
<trafaret1> o/
<efm> hello trafaret1
widp_ has joined #racket
Fare has joined #racket
ubLX has joined #racket
ubLIX has quit [Ping timeout: 272 seconds]
sagax has quit [Remote host closed the connection]
trafaret1 has quit [Remote host closed the connection]
sagax has joined #racket
catonano has quit [Quit: catonano]
pera has quit [Ping timeout: 252 seconds]
DGASAU has quit [Read error: Connection reset by peer]
bartbes has quit [Ping timeout: 268 seconds]
pera has joined #racket
catonano has joined #racket
Fare has quit [Ping timeout: 252 seconds]
vraid has quit [Quit: Leaving]
lispmacs has joined #racket
DGASAU has joined #racket
<lispmacs> hi, has anybody here played around withl live plotting of a data stream? I got pretty close to what I wanted with plot/dc, <https://stackoverflow.com/questions/37559856/racket-real-time-plot-chart>, but there is really bad blinking with each graph redraw
<lispmacs> evidentally no double buffering or anything
jao has joined #racket
pera has quit [Ping timeout: 245 seconds]
endformationage has quit [Quit: WeeChat 2.3]
bartbes has joined #racket
DGASAU has quit [Ping timeout: 246 seconds]
pera has joined #racket
buyfn has joined #racket
DGASAU has joined #racket
DGASAU has quit [Read error: Connection reset by peer]
pera has quit [Ping timeout: 250 seconds]
eddof13 has joined #racket
Fare has joined #racket
Fare has quit [Ping timeout: 246 seconds]
endformationage has joined #racket
Fare has joined #racket
buyfn has quit [Quit: buyfn]
pie__ has quit [Remote host closed the connection]
buyfn has joined #racket
vraid has joined #racket
pie__ has joined #racket
Fare has quit [Ping timeout: 246 seconds]
sauvin has quit [Read error: Connection reset by peer]
YuGiOhJCJ has joined #racket
widp_ has quit [Ping timeout: 245 seconds]
buyfn has quit [Quit: buyfn]
dimitarvp has joined #racket
Fare has joined #racket
acarrico has quit [Ping timeout: 268 seconds]
iclon has quit [Remote host closed the connection]
DGASAU has joined #racket
vraid has quit [Ping timeout: 246 seconds]
ZombieChicken has joined #racket
DGASAU has quit [Read error: Connection reset by peer]
widp_ has joined #racket
ubLX has quit [Quit: ubLX]
selimcan has quit [Ping timeout: 246 seconds]
eddof13 has quit [Quit: eddof13]
<friscosam> lispmacs: I have not, but I've thought of doing that in a project.
<friscosam> If you draw to a backing bitmap and then handle the drawing yourself maybe?
eddof13 has joined #racket
<friscosam> also I don't know if this auto-refreshes but may be worth looking into: https://alex-hhh.github.io/2019/02/data-visualization-dashboard.html
selimcan has joined #racket
efm has quit [Read error: Connection reset by peer]
efm has joined #racket
acarrico has joined #racket
Arcaelyx has joined #racket
efm has quit [Ping timeout: 240 seconds]
efm has joined #racket
<ZombieChicken> I'm trying to get a bit of code working, but I'm getting an unbound identifier error on (irc-connect ...).
<ZombieChicken> https://termbin.com/cg8d is the code. I'm trying to get this done using scribble/lp2, but something is clearly not working right
selimcan has quit [Remote host closed the connection]
acarrico has quit [Ping timeout: 240 seconds]
pera has joined #racket
badkins has quit [Ping timeout: 268 seconds]
<friscosam> I have never used scribble/lp2, but looking at the docs have you tried placing the requires in a chunk?
<friscosam> "When running the enclosing program, only the code inside the chunks is run; the rest is ignored."
badkins has joined #racket
<ZombieChicken> the exampes didn't seem to indicate that was needed, but that does seem to have done it. Thanks
<ZombieChicken> so now I have a mearly nonworking program to work with!
<friscosam> no problem
Sgeo_ has joined #racket
Falacer has quit [Ping timeout: 268 seconds]
Sgeo__ has quit [Ping timeout: 250 seconds]
pierpal has joined #racket
efm has quit [Ping timeout: 255 seconds]
ubLIX has joined #racket
Falacer has joined #racket
Fernando-Basso has joined #racket
Fare has quit [Ping timeout: 246 seconds]
efm has joined #racket
Falacer has quit [Ping timeout: 245 seconds]
acarrico has joined #racket
vraid has joined #racket
Fare has joined #racket
dimitarvp has quit [Quit: Bye]
dimitarvp has joined #racket
dimitarvp has quit [Client Quit]
Falacer has joined #racket
Fare has quit [Ping timeout: 245 seconds]
efm has quit [Remote host closed the connection]
efm has joined #racket
Falacer has quit [Ping timeout: 252 seconds]
efm has quit [Remote host closed the connection]
efm has joined #racket
Fare has joined #racket
amz3 has quit [Ping timeout: 252 seconds]
Fare has quit [Ping timeout: 272 seconds]
Fare has joined #racket
Fare has quit [Ping timeout: 246 seconds]
lispmacs has quit [Quit: rcirc on GNU Emacs 24.5.1]
efm has quit [Read error: Connection reset by peer]
Falacer has joined #racket
efm has joined #racket
Fare has joined #racket