00:01
DGASAU has joined #racket
00:06
dddddd has quit [Ping timeout: 246 seconds]
00:06
Sgeo_ has joined #racket
00:07
Fare has quit [Ping timeout: 255 seconds]
00:09
Sgeo__ has quit [Ping timeout: 255 seconds]
00:11
Sgeo__ has joined #racket
00:11
dddddd has joined #racket
00:14
Sgeo_ has quit [Ping timeout: 255 seconds]
00:22
pera has quit [Ping timeout: 245 seconds]
00:23
assertionerror has joined #racket
00:23
<
assertionerror >
Good evening everyone!
00:24
<
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?
00:26
Fare has joined #racket
00:28
<
bremner >
what do you mean by an "internal binding"?
00:31
<
assertionerror >
In (define (f x) (g x)) function g is an internal (bound) binding of function f.
00:32
<
dyl >
Naive take: (define (_f g x) (g x)), then (define (f x) (_f g x)) :p
00:32
<
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?
00:32
Fare has quit [Ping timeout: 252 seconds]
00:33
<
dyl >
The usual answer to "how can I make this easier to test" is "use more dependency inversion".
00:33
<
assertionerror >
Right.
00:33
<
dyl >
Is replacing g dynamically really what you want though? It's cute, but it's also fragile.
00:34
<
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'.
00:35
<
dyl >
Off the top of my head, you could define a custom eval function to use when loading their code into your test harness.
00:35
<
dyl >
Such that when it sees (define (g ...) ...) it slips in its own form instead.
00:35
<
dyl >
(warning: here be dragons)
00:36
<
assertionerror >
I see. Maybe it's my best bet. But apparently there's no obvious way of doing this via module magic, right?
00:37
<
dyl >
This might also be relevant
00:37
ng0 has quit [Quit: Alexa, when is the end of world?]
00:41
`micro has quit [Ping timeout: 250 seconds]
00:41
`micro has joined #racket
00:43
<
assertionerror >
Thanks, dyl! That looks interesting.
00:43
<
assertionerror >
Thanks for the brainstorm.
01:00
eddof13 has quit [Ping timeout: 246 seconds]
01:06
sz0 has quit [Quit: Connection closed for inactivity]
01:12
Fare has joined #racket
01:20
assertionerror has quit [Quit: assertionerror]
01:52
catonano_ has joined #racket
01:55
catonano has quit [Ping timeout: 245 seconds]
01:55
catonano_ is now known as catonano
02:05
pera has joined #racket
02:27
dddddd has quit [Remote host closed the connection]
02:28
pie__ has quit [Ping timeout: 252 seconds]
02:31
Fare has quit [Ping timeout: 246 seconds]
03:03
jao has quit [Ping timeout: 252 seconds]
03:06
efm has joined #racket
03:10
jao has joined #racket
03:10
efm has quit [Ping timeout: 246 seconds]
03:45
notzmv has joined #racket
04:11
jao has quit [Ping timeout: 250 seconds]
04:26
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
04:35
Fare has joined #racket
04:47
ubLIX has quit [Quit: ubLIX]
04:50
Sgeo_ has joined #racket
04:53
Sgeo__ has quit [Ping timeout: 246 seconds]
05:23
sauvin has joined #racket
05:24
_apg has joined #racket
05:49
endformationage has quit [Quit: WeeChat 2.3]
05:53
ZombieChicken has joined #racket
06:00
pera has quit [Ping timeout: 272 seconds]
06:14
zmt00 has joined #racket
06:17
zmt01 has quit [Ping timeout: 252 seconds]
06:20
Fare has quit [Ping timeout: 246 seconds]
06:25
Fare has joined #racket
06:43
<
ZombieChicken >
I'm getting a weird error when trying to run a little program. "...irc-client.rkt:11:3: irc-connect: unbound identifier"
06:43
<
ZombieChicken >
" in: irc-connect"
06:43
<
ZombieChicken >
I'm using the irc lib, and I am requiring it at the start of the file. Not sure what's going on
06:44
<
ZombieChicken >
I am trying to use scribble/lp, for what that might be worth
06:54
<
ZombieChicken >
nvm. Figured it out. Apparently @(require... needs more parens than I was using
07:22
Fare has quit [Ping timeout: 245 seconds]
08:19
ZombieChicken has quit [Ping timeout: 256 seconds]
08:39
buyfn has joined #racket
08:59
buyfn has quit [Quit: buyfn]
09:28
Falacer has joined #racket
09:36
bor0 has joined #racket
10:13
selimcan has joined #racket
10:14
ng0 has joined #racket
10:25
pie__ has joined #racket
10:37
emacsomancer has quit [Read error: Connection reset by peer]
10:56
dddddd has joined #racket
11:57
vraid has joined #racket
12:07
orivej has joined #racket
12:14
YuGiOhJCJ has joined #racket
13:03
bor0 has quit [Ping timeout: 252 seconds]
13:11
jao has joined #racket
13:39
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
14:01
amz3 has joined #racket
14:15
vraid has quit [Ping timeout: 268 seconds]
14:23
ubLIX has joined #racket
14:24
notzmv has quit [Ping timeout: 246 seconds]
14:25
vraid has joined #racket
14:43
jao has quit [Ping timeout: 250 seconds]
14:48
badkins_ is now known as badkins
14:48
buyfn has joined #racket
15:16
pera has joined #racket
15:17
Sgeo__ has joined #racket
15:20
Sgeo_ has quit [Ping timeout: 246 seconds]
15:34
buyfn has quit [Quit: buyfn]
15:43
widp_ has quit [Ping timeout: 246 seconds]
15:44
widp_ has joined #racket
15:44
efm has joined #racket
15:46
endformationage has joined #racket
15:51
widp_ has quit [Ping timeout: 246 seconds]
15:58
trafaret1 has joined #racket
16:12
<
efm >
hello trafaret1
16:17
widp_ has joined #racket
16:19
Fare has joined #racket
16:21
ubLX has joined #racket
16:24
ubLIX has quit [Ping timeout: 272 seconds]
16:29
sagax has quit [Remote host closed the connection]
16:36
trafaret1 has quit [Remote host closed the connection]
16:44
sagax has joined #racket
16:45
catonano has quit [Quit: catonano]
16:48
pera has quit [Ping timeout: 252 seconds]
17:00
DGASAU has quit [Read error: Connection reset by peer]
17:00
bartbes has quit [Ping timeout: 268 seconds]
17:03
pera has joined #racket
17:06
catonano has joined #racket
17:09
Fare has quit [Ping timeout: 252 seconds]
17:12
vraid has quit [Quit: Leaving]
17:14
lispmacs has joined #racket
17:14
DGASAU has joined #racket
17:15
<
lispmacs >
evidentally no double buffering or anything
17:20
jao has joined #racket
17:21
pera has quit [Ping timeout: 245 seconds]
17:24
endformationage has quit [Quit: WeeChat 2.3]
17:27
bartbes has joined #racket
17:29
DGASAU has quit [Ping timeout: 246 seconds]
17:31
pera has joined #racket
17:32
buyfn has joined #racket
17:39
DGASAU has joined #racket
17:40
DGASAU has quit [Read error: Connection reset by peer]
17:44
pera has quit [Ping timeout: 250 seconds]
17:46
eddof13 has joined #racket
17:47
Fare has joined #racket
18:06
Fare has quit [Ping timeout: 246 seconds]
18:06
endformationage has joined #racket
18:07
Fare has joined #racket
18:09
buyfn has quit [Quit: buyfn]
18:10
pie__ has quit [Remote host closed the connection]
18:12
buyfn has joined #racket
18:12
vraid has joined #racket
18:14
pie__ has joined #racket
18:15
Fare has quit [Ping timeout: 246 seconds]
18:21
sauvin has quit [Read error: Connection reset by peer]
18:22
YuGiOhJCJ has joined #racket
18:26
widp_ has quit [Ping timeout: 245 seconds]
18:36
buyfn has quit [Quit: buyfn]
18:39
dimitarvp has joined #racket
19:18
Fare has joined #racket
19:18
acarrico has quit [Ping timeout: 268 seconds]
19:23
iclon has quit [Remote host closed the connection]
19:29
DGASAU has joined #racket
19:33
vraid has quit [Ping timeout: 246 seconds]
19:34
ZombieChicken has joined #racket
19:36
DGASAU has quit [Read error: Connection reset by peer]
19:47
widp_ has joined #racket
19:57
ubLX has quit [Quit: ubLX]
20:05
selimcan has quit [Ping timeout: 246 seconds]
20:09
eddof13 has quit [Quit: eddof13]
20:10
<
friscosam >
lispmacs: I have not, but I've thought of doing that in a project.
20:10
<
friscosam >
If you draw to a backing bitmap and then handle the drawing yourself maybe?
20:10
eddof13 has joined #racket
20:18
selimcan has joined #racket
20:25
efm has quit [Read error: Connection reset by peer]
20:29
efm has joined #racket
20:30
acarrico has joined #racket
20:39
Arcaelyx has joined #racket
20:42
efm has quit [Ping timeout: 240 seconds]
20:45
efm has joined #racket
20:47
<
ZombieChicken >
I'm trying to get a bit of code working, but I'm getting an unbound identifier error on (irc-connect ...).
20:47
<
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
20:48
selimcan has quit [Remote host closed the connection]
20:53
acarrico has quit [Ping timeout: 240 seconds]
20:57
pera has joined #racket
21:03
badkins has quit [Ping timeout: 268 seconds]
21:09
<
friscosam >
I have never used scribble/lp2, but looking at the docs have you tried placing the requires in a chunk?
21:09
<
friscosam >
"When running the enclosing program, only the code inside the chunks is run; the rest is ignored."
21:09
badkins has joined #racket
21:10
<
ZombieChicken >
the exampes didn't seem to indicate that was needed, but that does seem to have done it. Thanks
21:10
<
ZombieChicken >
so now I have a mearly nonworking program to work with!
21:15
<
friscosam >
no problem
21:18
Sgeo_ has joined #racket
21:20
Falacer has quit [Ping timeout: 268 seconds]
21:21
Sgeo__ has quit [Ping timeout: 250 seconds]
21:29
pierpal has joined #racket
21:42
efm has quit [Ping timeout: 255 seconds]
21:46
ubLIX has joined #racket
21:47
Falacer has joined #racket
21:50
Fernando-Basso has joined #racket
21:59
Fare has quit [Ping timeout: 246 seconds]
22:00
efm has joined #racket
22:07
Falacer has quit [Ping timeout: 245 seconds]
22:22
acarrico has joined #racket
22:30
vraid has joined #racket
22:37
Fare has joined #racket
22:40
dimitarvp has quit [Quit: Bye]
22:43
dimitarvp has joined #racket
22:43
dimitarvp has quit [Client Quit]
22:47
Falacer has joined #racket
22:50
Fare has quit [Ping timeout: 245 seconds]
23:06
efm has quit [Remote host closed the connection]
23:06
efm has joined #racket
23:07
Falacer has quit [Ping timeout: 252 seconds]
23:13
efm has quit [Remote host closed the connection]
23:15
efm has joined #racket
23:15
Fare has joined #racket
23:23
amz3 has quit [Ping timeout: 252 seconds]
23:33
Fare has quit [Ping timeout: 272 seconds]
23:35
Fare has joined #racket
23:39
Fare has quit [Ping timeout: 246 seconds]
23:44
lispmacs has quit [Quit: rcirc on GNU Emacs 24.5.1]
23:49
efm has quit [Read error: Connection reset by peer]
23:50
Falacer has joined #racket
23:55
efm has joined #racket
23:57
Fare has joined #racket