00:19 (join) nilyaK1 00:22 (quit) nilyaK: Ping timeout: 276 seconds 00:46 (quit) dnolen: Quit: ERC Version 5.3 (IRC client for Emacs) 01:18 (join) anonus 01:36 (join) Demosthenes 01:37 (quit) jyc: Ping timeout: 240 seconds 01:37 (quit) Demosthenes: Client Quit 01:42 (join) Demosthenes 01:46 (quit) yoklov: Quit: computer sleeping 01:46 (join) jyc 02:02 (join) kvda 02:12 (join) hkBst 02:12 (quit) hkBst: Changing host 02:12 (join) hkBst 02:15 (quit) neilv: Quit: Leaving 02:26 (quit) mithos28: Quit: mithos28 02:45 (quit) jesyspa: Quit: leaving 02:56 (quit) jonrafkind: Ping timeout: 240 seconds 03:24 (join) bluezenix 03:39 (join) scvrory 03:45 (join) untrusted 03:58 (quit) untrusted: Remote host closed the connection 04:03 (quit) jyc: Read error: Connection reset by peer 04:07 (quit) nilyaK1: Quit: Leaving. 04:31 (join) antithesis 04:43 (join) bluezenix1 04:43 (quit) bluezenix: Read error: Connection reset by peer 05:01 (join) masm 05:17 (join) cdidd 05:26 (quit) Shvillr: Ping timeout: 244 seconds 05:26 (join) Shvillr 05:42 (join) bitonic 06:07 (join) noelw 06:13 (join) mye 06:14 (join) mye_ 06:17 (quit) mye: Ping timeout: 244 seconds 06:33 (quit) bluezenix1: Quit: Leaving. 06:35 (join) bluezenix 06:40 (join) duomo 06:43 (quit) duomo: Remote host closed the connection 07:14 (quit) Shvillr: Read error: Connection reset by peer 07:16 (join) mye__ 07:20 (quit) mye_: Ping timeout: 260 seconds 07:52 (quit) Quetzalcoatl_: Ping timeout: 250 seconds 07:59 (quit) Demosthenes: Quit: leaving 08:04 (quit) antithesis: Quit: yes leaving 08:05 (join) kanak 08:07 (quit) kanak: Remote host closed the connection 08:09 (quit) mye__: Quit: Leaving 08:10 (quit) cdidd: Ping timeout: 276 seconds 08:24 (join) cdidd 08:29 (join) duomo 08:42 (quit) duomo: Quit: Linkinus - http://linkinus.com 08:45 (quit) kvda: Quit: x__x 08:46 (join) zyoung 09:01 (join) jonathansizz 09:01 (join) getpwnam 09:02 (join) hash_table 09:09 (join) jeapostrophe 09:17 (join) kanak 09:35 (quit) jeapostrophe: Ping timeout: 244 seconds 09:44 (join) dnolen 09:47 (join) jesyspa 09:53 (join) mceier 09:57 (quit) jrslepak: Quit: This computer has gone to sleep 10:26 (join) gciolli 10:28 (join) anRch 10:36 (quit) gciolli: Quit: Leaving. 10:41 (join) mithos28 10:43 (join) untrusted 11:02 (quit) dnolen: Ping timeout: 244 seconds 11:04 (join) jao 11:04 (quit) jao: Changing host 11:04 (join) jao 11:06 (join) antithesis 11:06 (nick) emma -> em 11:06 (join) ambrosebs 11:07 (join) morthwylion 11:07 (quit) morthwylion: Client Quit 11:21 (join) plobzik 11:24 (quit) plobzik: Read error: Connection reset by peer 11:35 (quit) hkBst: Quit: Konversation terminated! 11:37 (quit) anRch: Quit: anRch 11:45 (join) osa1 11:46 (part) osa1 11:49 (quit) bluezenix: Quit: Leaving. 11:51 (quit) getpwnam: Read error: Connection reset by peer 11:51 (quit) hash_table: Read error: Connection reset by peer 11:51 (quit) jonathansizz: Quit: bye 11:54 (quit) untrusted: Remote host closed the connection 11:56 (join) getpwnam 11:57 (join) hash_table 11:59 (join) yoklov 12:07 (join) anRch 12:13 (quit) noelw: Quit: noelw 12:13 (quit) yoklov: Quit: bye! 12:19 (join) jonrafkind 12:24 (quit) bitonic: Quit: WeeChat 0.3.7 12:31 (quit) anRch: Read error: Connection reset by peer 12:32 (join) stis 12:32 (join) anRch 12:35 (join) jonathansizz 12:41 (quit) anRch: Quit: anRch 12:45 (quit) ambrosebs: Ping timeout: 248 seconds 12:55 (join) aalix 13:11 (join) mye 13:18 (join) bluezenix 13:33 shawnps: is there a way i can use RackUnit to assert that, after calling a given function, another function was called with certain arguments? 13:33 shawnps: i only see stuff like, asserting that the function returns a specific number or stuff like that 13:39 (quit) bluezenix: Quit: Leaving. 13:44 (quit) scvrory: Quit: leaving 13:59 (join) anRch 14:07 asumu: shawnps: I don't think Rackunit can do that. In general, that doesn't sound like a very good unit test. 14:07 asumu: Since it depends on your implementation and not the interface. 14:08 Cryovat: https://gist.github.com/0327cc8a55c4d2f3030b 14:08 Shambles_: I tried the first example on this page: http://docs.racket-lang.org/guide/prompt.html It doesn't return or otherwise display 0 as shown. 14:08 Cryovat: Am I doing something obviously wrong in that code? 14:08 shawnps: the thing is, the code i want to test makes GET, POST, PUT, DELETE requests 14:13 (quit) getpwnam: Ping timeout: 248 seconds 14:13 (quit) jonathansizz: Ping timeout: 256 seconds 14:13 Shambles_: The second example works as advertised, but I'm not sure I understand why. The debugger shows it 'jumps' to the default-continuation-prompt-tag before evaluating the lambda with all those + 1's, then runs the 'escape' code as expected, then jumps back to the same default-continuation-prompt-tag, and returns the value. 14:13 (quit) hash_table: Ping timeout: 265 seconds 14:14 Shambles_: I'm not sure why the first jump happens at all, or why the second one doesn't jump to the inner default-continuation-prompt-tag. 14:24 (quit) jesyspa: Quit: leaving 14:25 (join) snearch 14:27 (join) jesyspa 14:29 asumu: Cryovat: I think that may be a bug, let me check. 14:29 shawnps: I get the same problem with Cryovat's code 14:30 asumu: Shambles_: I tried that example (the one with escape right?) and it produced 0. 14:30 Shambles_: asumu: I've tried it several times, it produces nothing at all for me. I'm on Windows XP and running 5.2.1 at the moment. 14:31 Cryovat: asumu: It might very well be me missing something though 14:31 Shambles_: Another, more interesting thing, is if I paste the whole thing (removing the output and the ">" parts) into the code area the first example (the one intended to cause 0 to be returned) prevents the second from evaluating at all. 14:31 Cryovat: The Typed Racket documentation on the for/ forms is... brief 14:32 asumu: rudybot: (define (escape v) 14:32 asumu: (abort-current-continuation 14:32 asumu: (default-continuation-prompt-tag) 14:32 rudybot: asumu: I think compile-mode is to fix to be able to cope with escape sequences. 14:32 asumu: Ugh. 14:32 asumu: rudybot: (define (escape v) (abort-current-continuation)) 14:32 rudybot: asumu: your sandbox is ready 14:32 rudybot: asumu: Done. 14:32 asumu: rudybot: (+ 1 (+ 1 (escape 0)) 14:32 rudybot: asumu: GNU in general is still really bad about spaces; it's more or less impossible to escape spaces properly in a Makefile, and I've tried, oh my god have I tried, I tried every single time. 14:32 asumu: rudybot: (+ 1 (+ 1 (escape 0))) 14:32 rudybot: asumu: error: abort-current-continuation: expects at least 1 argument, given 0 14:33 asumu: rudybot: (define (escape v) (abort-current-continuation (lambda () v))) 14:33 rudybot: asumu: Done. 14:33 asumu: rudybot: (+ 1 (+ 1 (escape 0))) 14:33 rudybot: asumu: error: abort-current-continuation: expects argument of type ; given: # 14:33 asumu: rudybot: (define (escape v) (abort-current-continuation (default-continuation-prompt-tag) (lambda () v))) 14:33 rudybot: asumu: Done. 14:33 asumu: rudybot: (+ 1 (+ 1 (escape 0))) 14:33 rudybot: asumu: ; Value: 0 14:33 (join) bluezenix 14:34 asumu: Shambles_: Did you just run the example unmodified? 14:34 asumu: Or maybe in DrRacket? I didn't try it there. 14:35 asumu: Oh... it doesn't do the same thing in DrRacket. 14:35 Shambles_: asumu: I pasted it in the upper window in DrRacket. I wanted to watch it in the debugger, since I didn't understand how the control flow was supposed to work (and still don't). 14:35 Shambles_: And I just restarted it, cut/pasted it, edited out the stuff not meant to run, and it does the same thing, so I don't think I messed up. 14:36 Shambles_: The second example works as it's supposed to, as far as I can tell, I just don't understand why it behaves as it does. The first one definitely does not work as advertised. 14:38 asumu: Shambles_: It has something to do with the prompt that DrRacket itself installs in the REPL. 14:38 asumu: In the second example, the extra prompt catches the abort so it's ok. 14:38 Shambles_: asumu: Does this mean I found a bug, or is it not supposed to work in DrRacket? Probably aught to be a note if it's not supposed to work there. 14:40 asumu: Could be a bug. Either way, you should submit a bug report since either DrRacket or the docs should be fixed. 14:40 (quit) snearch: Quit: Verlassend 14:41 asumu: shawnps: can you test your code by sending the requests on a dummy port? 14:41 Shambles_: asumu: How would I go about doing that? 14:43 Shambles_: I think I found the link. Here? http://bugs.racket-lang.org/ 14:46 asumu: Shambles_: Yep, that's it. Sorry, my web browser was down so I didn't have the link handy. 14:46 asumu: Cryovat: I think you've found a bug. #hash() has the wrong type basically. 14:47 asumu: In the mean-time, you should be able to write a version of get-dict directly with recursion using make-hash, hash-set, etc. 14:47 Cryovat: Ah, ok 14:47 Cryovat: Thanks :) 14:47 asumu: (we'll try to fix the bug) 14:48 Shambles_: asumu: That's okay. Since I'm sort of 'stuck' here, could you help explain that part of the documentation to me? I understand exceptions just fine. I understand the concept of a continuation, but haven't actually used them much. I've tried watching both examples in the debugger. Here goes my interpretation of the first one. 14:49 (join) snearch 14:50 Shambles_: asumu: The function "escape" is defined. Then the outermost (+ 1 ... starts being applied. The nested (+ 1 s are arguments so it starts trying to apply those. Eventually it hits "escape". The function's code is evaluated as expected. It passes over abort-current-continuation, then default-continuation-prompt-tag, and then stops. That's what seems to happen in the debugger. 14:52 Shambles_: asumu: What I find confusing in all this is I would expect the 'abort' to cause unwinding to start as soon as it was struck, instead of it being passed over. Maybe this has something to do with 'applying' it, so it has to evaluate the default-continuation-prompt-tag first?). Either way I wouldn't ever expect the lambda to be evaluated, and seems it's not. Can you explain what's supposed to happen and why? 14:52 asumu: Shambles_: abort-current-continuation will jump to the nearest continuation prompt with the appropriate tag (here the default one). 14:52 asumu: (skipping over all the code in between) 14:53 Shambles_: asumu: How does it know where to jump to? Doesn't the tag have to be set already, by having been struck before the abort? 14:53 asumu: The REPL sets it at the "prompt" (in the command-line sense). 14:54 asumu: If you ran it with a tag you make up, then it will tell you it couldn't find a prompt to jump to. 14:54 asumu: i.e., try replacing (default-continuation-prompt-tag) with (make-continuation-prompt-tag). 14:54 asumu: The jump will fail. 14:54 Shambles_: asumu: Where would "a tag you make up" go? 14:55 Shambles_: Oh, I see. 14:55 Shambles_: Need to use make-continuation-prompt-tag. 14:56 Shambles_: asumu: Am I right that the reason it even tries to do anything after hitting abort-current-continuation is because it still needs to 'apply' that, which causes it to evaluate the default-continuation-prompt-tag inside it? 14:58 (quit) anRch: Quit: anRch 15:00 asumu: Shambles_: Yeah, it's a function so its arguments will be evaluated first. 15:06 Shambles_: asumu: I guess hitting the default-continuation-prompt-tag inside it doesn't cause it to immediately start unwinding. That's why the lambda was supposed to be evaluated, and produce the 0? 15:13 (join) getpwnam 15:13 (join) jonathansizz 15:14 (join) Shvillr 15:14 (join) hash_table 15:16 (quit) masm: Read error: Operation timed out 15:16 (join) masm 15:20 asumu: Shambles_: Right, the prompt tag just evaluates to a value. 15:21 jonrafkind: oh struct accessors.. how i loathe thee 15:21 Shambles_: asumu: Okay, now to the concept... Seems to me like the tag for 'where to restore to' was set inside the function that's supposed to start unwinding when it's done, so it should end up in a infinitely loop, going to that state, and trying to unwind, and then going to that state... Why is that not what's expected to happen? 15:23 asumu: Because the prompt tag is evaluated before the function is actually called. When abort is called, it then proceeds to jump to the nearest prompt with the tag. 15:23 asumu: When the abort is called, it discards the entire continuation up to the prompt. 15:24 asumu: So it can't actually go back. 15:24 asumu: Now, if you had captured a continuation instead of aborting, you could go back. 15:27 Shambles_: Hmm. So the abort sets the tag inside, and all the stuff inside is supposed to finish, and then the abort happens, and it starts unwinding, but basically there's not anything to unwind now (there weren't any stack frames between the tag and the abort)... So why doesn't it end up trying to add up all those + 1's? 15:28 asumu: In the first example? In that example, it aborts all the way to the REPL prompt so the +1s are all discarded. 15:28 asumu: In the 2nd example, there is only one +1 outside of the prompt, which does happen. 15:28 asumu: But the inner +1s are all obliterated by the abort. 15:30 Shambles_: I'm just trying to understand what the first is supposed to do. The second is more confusing. 15:30 asumu: Oh, well that jumps to the prompt/top-level so it has nothing left to do. 15:30 asumu: So it's just 0. 15:31 Shambles_: In terms of exception handlers, what I would expect to happen, I guess, is the handler 'inside' the part throwing the exception to not do anything useful, since it's not outside the scope of the throwing part, and then it to unwind all the way back to the start and die with a error. Is that what actually happens? 15:31 Shambles_: Minus the error part. 15:32 asumu: It unwinds all the way back to the prompt (if you want to think of that as "the start") and returns a value. So yeah, in a way this is like "raise" an exception. 15:32 asumu: With a handler that does nothing. 15:32 asumu: (just returns the value) 15:33 Shambles_: So that default-continuation-prompt-tag inside the abort thing is just a red herring. It's not doing anything? 15:33 asumu: Yes. In fact, I'm puzzled why it requires the prompt tag argument rather than have it be an optional arg. 15:33 asumu: (and default to the default tag) 15:34 Shambles_: Okay, cool, I understand that part. 15:34 asumu: In general, the tag is useful. 15:34 Shambles_: Now the second one has me extremely confused. 15:34 asumu: Since it lets you use several "kinds" of control that don't interfere with each other. 15:34 asumu: (irrelevant in this example) 15:35 Shambles_: The part that bothers me is that it goes from call-with-continuations-prompt to default-continuation-prompt-tag immediately. It doesn't even try to use the lambda. That's not the only thing, but it's the most disturbing thing. Why is it the evaluation isn't happening the way it usually does? 15:36 asumu: The lambda is just an argument. It can use it or not. 15:37 asumu: (though call-with-continuation-prompt does use it) 15:44 Shambles_: So it's not tried to evaluate that yet, which is why it skips to the second part? 15:44 asumu: Yes. 15:45 asumu: You can think of evaluating a lambda as really just allocating it on the heap or whatever. 15:49 Shambles_: Okay, so like the first time, when it evaluates escape, the inner default-continuation-prompt-tag doesn't do anything. This results in it going back to the one that does 'do something', the one we just set, which ends the evaluation of call-with-continuation-prompt (since it skips to the end, avoiding the lambda), and that just leaves you with (+ 1) which is where the 1 comes from in output? 15:50 Shambles_: The outermost + 1 15:53 asumu: Cryovat: made some progress on fixing that bug, but your example still doesn't run. 15:53 asumu: Can you submit a but report? 15:53 Cryovat: Sure 15:53 (join) RacketCommitBot 15:53 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/JDPhHg 15:53 RacketCommitBot: [racket/master] TR: Fix type-checking of hash literals. - Asumu Takikawa 15:53 (part) RacketCommitBot 15:54 asumu: s/but/bug/ 15:55 asumu: Shambles_: it actually runs the lambda passed to it, which then does the abort. 15:55 asumu: It aborts to the prompt, providing 0 to the context (+ 1 []). 15:56 Shambles_: I see what you mean, and wasn't thinking clearly. If it hadn't you wouldn't have hit the escape. But the rest of what I said was right, right? 15:59 Cryovat: asumu: Done 16:00 asumu: Cryovat: thanks. 16:00 Cryovat: 12787 for reference 16:00 asumu: Shambles_: I think so, yeah. 16:01 Cryovat: Without stepping too hard on your toes, the official bug tracker isn't the newest thing I've seen around the web :| 16:03 Shambles_: asumu: Okay. Thanks for helping me wade through all that. 16:05 asumu: Cryovat: We're in the process of migrating to github. 16:05 (quit) bluezenix: Quit: Leaving. 16:05 Cryovat: Ah, that's good 16:05 asumu: Once the entire bug database is migrated there, the old interface will be deprecated. 16:17 (quit) dented42: Ping timeout: 244 seconds 16:18 (join) bluezenix 16:23 (join) mye_ 16:27 (quit) mye: Ping timeout: 256 seconds 16:37 (join) jeapostrophe 16:37 (quit) jeapostrophe: Changing host 16:37 (join) jeapostrophe 16:42 (join) djcb 16:45 (join) ambrosebs 16:54 (quit) antithesis: Quit: yes leaving 16:58 (quit) jesyspa: Ping timeout: 256 seconds 16:59 (join) jesyspa 17:03 (join) dented42 17:15 (quit) dented42: Quit: Computer has gone to sleep. 17:16 (part) stis 17:16 (quit) bluezenix: Quit: Leaving. 17:26 (join) dented42 17:27 (quit) cdidd: Remote host closed the connection 17:31 (quit) jesyspa: Ping timeout: 248 seconds 17:32 (join) jesyspa 17:34 asumu: Shambles_: I figured out why DrRacket has different prompt behavior. Going to discuss it on racket-dev and we'll see what happens. 17:34 Shambles_: asumu: I'm glad you figured it out. 17:51 (part) ambrosebs 17:54 (join) mye__ 17:57 (quit) mye_: Ping timeout: 244 seconds 17:58 (quit) jonrafkind: Ping timeout: 245 seconds 18:12 (join) jonrafkind 18:22 (join) jyc 18:23 (quit) zyoung: Read error: Operation timed out 19:01 (join) zyoung 19:19 (quit) jeapostrophe: Ping timeout: 276 seconds 19:21 (quit) snearch: Quit: Verlassend 19:33 (join) DanBurton 19:34 DanBurton: so I'm trying to write a macro that can be used inside of type declarations in Typed Racket 19:34 DanBurton: is that possible? 19:34 (quit) jonrafkind: Ping timeout: 252 seconds 19:35 (quit) mceier: Quit: leaving 19:41 (quit) ivan`: Ping timeout: 245 seconds 19:42 (quit) elliottcable: Ping timeout: 245 seconds 19:43 (quit) tauntaun: Ping timeout: 276 seconds 19:43 (quit) shawnps: Ping timeout: 252 seconds 19:45 (quit) rapacity: Ping timeout: 265 seconds 19:50 (join) dnolen 19:52 (join) nilyaK 20:07 (join) ivan` 20:23 (join) jrslepak 20:30 (quit) nilyaK: Quit: Leaving. 20:34 (join) kvda 20:35 (quit) masm: Quit: Leaving. 20:39 (join) shawnps 20:39 (join) tauntaun 20:39 (nick) tauntaun -> Guest7514 20:43 (quit) zyoung: Remote host closed the connection 20:45 (join) tauntaun_ 20:47 (quit) dented42: Quit: Computer has gone to sleep. 20:48 (quit) kvda: Quit: Computer has gone to sleep. 20:49 (join) kvda 20:50 (quit) tauntaun_: Ping timeout: 240 seconds 20:51 (join) tauntaun_ 20:51 (quit) aalix: Ping timeout: 260 seconds 20:56 (quit) tauntaun_: Ping timeout: 240 seconds 20:58 (join) tauntaun_ 21:02 (quit) tauntaun_: Ping timeout: 244 seconds 21:03 (join) tauntaun_ 21:04 (quit) sid0: Ping timeout: 246 seconds 21:11 (join) sid0 21:13 (quit) tauntaun_: Ping timeout: 240 seconds 21:19 (join) tauntaun_ 21:23 (quit) DanBurton: Quit: leaving 21:30 (quit) tauntaun_: Ping timeout: 265 seconds 21:30 (join) tauntaun_ 21:35 (quit) tauntaun_: Ping timeout: 256 seconds 21:41 (join) tauntaun_ 21:52 (join) rapacity 22:13 (join) elliottcable 22:40 (join) jonrafkind 23:13 (quit) cky: Ping timeout: 244 seconds 23:13 (quit) karswell: Remote host closed the connection 23:18 (quit) dnolen: Ping timeout: 244 seconds 23:18 (join) karswell 23:49 (join) dented42 23:57 (quit) ivan\: Ping timeout: 252 seconds 23:59 (join) ambrosebs