00:04 bamaung: hi asumu i m new to racket and i m using emacs. is there any library like slime for racket? 00:06 (quit) wtetzner: Remote host closed the connection 00:08 asumu: bamaung: Try Geiser http://www.nongnu.org/geiser/ 00:12 bamaung: asumu: thanks 00:12 asumu: NP. 00:17 (quit) zyoung: Remote host closed the connection 00:43 (part) bamaung: "ERC Version 5.3 (IRC client for Emacs)" 00:46 (quit) jao: Ping timeout: 272 seconds 00:48 (quit) getpwnam: Ping timeout: 265 seconds 00:59 (quit) rahul_: Ping timeout: 248 seconds 00:59 (quit) __rahul__: Ping timeout: 265 seconds 01:03 (join) rahul_ 01:03 (join) __rahul__ 01:05 Shambles_: I found a proofreading error on http://docs.racket-lang.org/guide/module-basics.html the diagram that shows how modules could be organized for a candy sorter has the contents of the database and machine blocks swapped. The text is right, but the diagram is wrong. 01:07 asumu: Shambles_: Thanks for reporting it. It's been fixed in the pre-release though: http://pre.racket-lang.org/docs/html/guide/module-basics.html 01:07 Shambles_: asumu: Sorry. Just thought I'd mention it. 01:12 asumu: No need for apology, please report doc errors zealously. :) 01:31 (quit) yoklov: Quit: bye! 02:14 (quit) jeapostrophe: Ping timeout: 252 seconds 02:18 (join) plobzik 02:21 (quit) plobzik: Read error: Connection reset by peer 02:23 (join) nilyaK 02:24 (quit) cdidd: Read error: Operation timed out 02:37 (quit) jonrafkind: Ping timeout: 245 seconds 02:50 (join) tfb 03:07 (quit) tfb: Quit: gone 03:20 (quit) rahul_: Ping timeout: 260 seconds 03:20 (quit) __rahul__: Ping timeout: 260 seconds 03:24 (join) antithesis 03:32 (join) __rahul__ 03:33 (quit) jacius: Quit: Leaving 03:40 (join) rahul_ 03:44 (quit) kvda: Quit: Computer has gone to sleep. 03:56 (join) Shvillr 03:57 (quit) Shviller: Ping timeout: 245 seconds 04:16 (join) bluezenix 04:19 (join) noelw 04:34 (join) tfb 04:50 (join) ambrosebs 04:52 (quit) ambrosebs: Client Quit 04:52 (join) ambrosebs 04:53 (join) cdidd 04:53 ambrosebs: How do I get a value out of a Vector in Typed Racket? 04:53 ambrosebs: I want to use vector-ref 04:53 ambrosebs: but it wants a (Vectorof a) 04:54 ambrosebs: do I convert the vector somehow? 04:59 (join) nilyaK1 05:01 noelw: What is the error message? 05:03 (quit) nilyaK: Ping timeout: 248 seconds 05:05 (quit) antithesis: Quit: yes leaving 05:15 (join) mceier 05:19 ambrosebs: Type Checker: Polymorphic function vector-ref could not be applied to arguments: 05:19 ambrosebs: Argument 1: 05:19 ambrosebs: Expected: (Vectorof a) 05:19 ambrosebs: Given: Vector 05:20 ambrosebs: Argument 2: 05:20 ambrosebs: Expected: Integer 05:20 ambrosebs: Given: One 05:20 ambrosebs: in: (vector-ref a 1) 05:21 ambrosebs: My code: 05:21 ambrosebs: (define: a : Any #{1 2}) 05:21 ambrosebs: (and (vector? a) (vector-ref a 1)) 05:22 ambrosebs: I'm testing occurrence typing 05:22 noelw: You've given a type Any 05:23 ambrosebs: is there no way to recover (Vectorof Any) ? 05:28 ambrosebs: is there a function (Vector Index -> Any) ? 05:29 ambrosebs: it seems odd to me that vector? isn't a predicate of (Vectorof Any) 05:35 ambrosebs: I guess I can make my own predicate 05:36 (join) jesyspa 05:43 ambrosebs: I can't find a solution. Impossible? 05:45 (quit) nilyaK1: Quit: Leaving. 05:47 (join) masm 05:51 (join) rahul__ 05:54 (join) antithesis 06:00 ambrosebs: oh, (define-predicate vector-of? (Vector Any)) fixed it 06:01 (join) bitonic 06:01 (quit) __rahul__: Quit: Leaving 06:10 (join) camilo_ 06:11 (quit) rahul_: Remote host closed the connection 06:11 (quit) rahul__: Remote host closed the connection 06:12 jamessan: ambrosebs: your define isn't typing a as (Vectorof Any), but as Any. your code works fine for me with a slight adjustment -- (define: a : (Vectorof Any) #{1, 2}) 06:23 (quit) ivan\: Quit: ERC Version 5.3 (IRC client for Emacs) 06:27 ambrosebs: jamessan: right, I have a function that takes (Any Any -> Boolean), and both parameters could be vectors 06:28 ambrosebs: and I wanted to recover that they could be (Vectorof Any) 06:37 ambrosebs: I think it makes sense that I need to define a new predicate 06:59 ambrosebs: shouldn't the type for hash-ref allow the optional 3rd argument to be a value, not just a lambda? 07:00 ambrosebs: > hash-ref 07:00 ambrosebs: - : (All (a b c) (case-> ((HashTable a b) a -> b) ((HashTable a b) a (-> c) -> (U b c)))) 07:00 ambrosebs: strange use of "value", but I think you get the idea :P 07:04 ambrosebs: (hash-ref some-hash key #f) doesn't fit the type sig, but seems valid to me 07:10 (join) tyson1 07:10 (part) tyson1 07:12 (join) tyson1 07:13 (part) tyson1 07:19 (quit) camilo_: Read error: Operation timed out 07:47 (join) camilo_ 07:49 (join) ivan\ 07:54 (part) camilo_: "Ex-Chat" 08:05 (join) kanak 08:06 ambrosebs: is a Function in typed racket kind of like an intersection type of arities? 08:06 ambrosebs: would there be any harm representing it as an intersection? 08:17 (join) jeapostrophe 08:19 (quit) ivan\: Ping timeout: 248 seconds 08:20 (quit) tfb: Ping timeout: 255 seconds 08:21 (join) ivan\ 08:42 (join) netrino 08:46 (join) zyoung 08:48 (join) getpwnam 08:50 (quit) Demosthenes: Ping timeout: 245 seconds 08:57 (join) stis 09:31 (join) jasoegaard 09:38 (quit) getpwnam: Ping timeout: 260 seconds 10:00 (join) snearch 10:01 (quit) snearch: Read error: Connection reset by peer 10:01 (join) snearch 10:05 (join) dnolen 10:06 (join) djcb 10:17 (quit) jeapostrophe: Read error: Operation timed out 10:22 (join) flying_rhino 10:32 (nick) samth_ -> samth 10:32 samth: ambrosebs: yes, `Function' is a collection of arities, which are treated as an ordered intersection 10:33 samth: see our PADL 2012 paper for a few more details about this 10:37 (join) aalix 10:37 ambrosebs: samth: perfect! thanks :) 10:41 (join) RacketCommitBot 10:41 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/xuk7pQ 10:41 RacketCommitBot: [racket/master] win64: glib DLL depends on libintl - Matthew Flatt 10:41 RacketCommitBot: [racket/master] fix non-portable test - Matthew Flatt 10:41 (part) RacketCommitBot 10:46 ambrosebs: samth: is the decidability of intersection types related to order? 10:46 (join) getpwnam 10:47 samth: ambrosebs: i think it would be decideable even without that 10:48 samth: the important restriction for decideability is that it's limited to function types 10:48 ambrosebs: ah 10:50 ambrosebs: I was hoping to use general intersection types in typed clojure, but I don't know where it gets hard 10:50 ambrosebs: wasn't aware it was undecideable either 10:51 samth: with general intersection types, you can type all of the lambda calculus terms that terminate 10:53 ambrosebs: it that bad? 10:58 (quit) jrslepak: Quit: This computer has gone to sleep 11:03 samth: ambrosebs: that solves the halting problem 11:06 ambrosebs: samth: ok, I'm not understanding some terminology. I was expecting to be bad if we can type `non' terminating terms, and good if we can type terminating terms. Where have I gone wrong? 11:29 (quit) djcb: Read error: Connection reset by peer 11:31 (join) djcb 11:38 (join) jao 11:38 (quit) jao: Changing host 11:38 (join) jao 11:42 (join) wah_java 11:42 (quit) wahjava: Read error: Connection reset by peer 11:43 (nick) wah_java -> wahjava 11:49 (quit) netrino: Ping timeout: 244 seconds 11:51 (join) netrino 11:55 asumu: ambrosebs: The problem is you can set your type system up so that the set of type-checkable terms are the halting terms. That means running your type-checker is a decision procedure for the halting problem. 11:55 asumu: Which is undecidable. 11:56 asumu: OTOH, if your type system could identify all terms *but* the halting terms, it's probably just as bad. 11:56 asumu: (but that doesn't actually happen) 11:58 (quit) djcb: Read error: Connection reset by peer 12:00 (join) djcb 12:02 ambrosebs: asumu: interesting, thanks 12:04 (join) mye 12:04 (quit) djcb: Read error: Connection reset by peer 12:06 (join) djcb 12:09 (join) jeapostrophe 12:16 (join) jonrafkind 12:16 (quit) jonrafkind: Changing host 12:16 (join) jonrafkind 12:30 (join) RacketCommitBot 12:30 RacketCommitBot: [racket] plt pushed 5 new commits to master: http://git.io/SYEdkg 12:30 RacketCommitBot: [racket/master] Start improving file system usage - Jay McCarthy 12:30 RacketCommitBot: [racket/master] New archives, smaller - Jay McCarthy 12:30 RacketCommitBot: [racket/master] Only repair the big archives - Jay McCarthy 12:30 (part) RacketCommitBot 12:33 (quit) jesyspa: Ping timeout: 244 seconds 12:35 (join) jesyspa 12:54 friscosam: asumu: re: Jazzscheme modules. I don't remember if jazzscheme uses gambit's module system, but the last time I looked it was not totally documented and (I think) you could have identifier collisions 12:59 (join) RacketCommitBot 12:59 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/3Fiq_A 12:59 RacketCommitBot: [racket/master] add "alias" and "converted-arguments-variant" properties - Matthew Flatt 12:59 (part) RacketCommitBot 13:10 (join) karswell 13:15 (quit) snearch: Quit: Verlassend 13:25 (join) bluezenix1 13:26 (quit) bluezenix: Ping timeout: 272 seconds 13:49 (quit) cdidd: Ping timeout: 265 seconds 13:50 (quit) djcb: Read error: Connection reset by peer 13:52 (join) djcb 14:01 (join) jrslepak 14:05 (join) sstrickl 14:10 (quit) acarrico: *.net *.split 14:10 (quit) cataska_: *.net *.split 14:10 (quit) jrslepak_neu: *.net *.split 14:10 (quit) jschuster: *.net *.split 14:10 (join) jrslepak_neu 14:10 (join) acarrico 14:10 (join) cataska_ 14:10 (join) jschuster 14:31 (quit) djcb: Read error: Connection reset by peer 14:31 (join) djcb 14:33 anonus: is it possible to make geiser to display docs about racket's functions ? 14:37 (join) anRch 14:38 (join) bluezenix 14:41 (quit) bluezenix1: Ping timeout: 245 seconds 14:45 (part) sstrickl 14:45 (join) sstrickl_away 14:46 (nick) sstrickl_away -> sstrickl 14:47 (part) sstrickl 14:47 (join) sstrickl 14:50 asumu: anonus: I don't know if geiser does, but I know some people here have emacs bindings to do that. 14:50 asumu: stamourv: ^ 14:50 (quit) acarrico: *.net *.split 14:50 (quit) cataska_: *.net *.split 14:50 (quit) jschuster: *.net *.split 14:51 (join) acarrico 14:51 (join) cataska_ 14:51 (join) jschuster 14:55 (join) hash_table 14:55 (quit) bluezenix: Quit: Leaving. 14:56 (nick) hash_table -> brogrammer 14:58 (quit) jrslepak: Quit: This computer has gone to sleep 15:01 (join) ynniv 15:03 (join) bro_down 15:29 (quit) anRch: Quit: anRch 15:33 (join) noam 15:37 (join) bluezenix 15:44 (quit) jonrafkind: Quit: Ex-Chat 15:45 (join) jonrafkind 16:02 (join) jrslepak 16:17 (quit) Kaylin: Quit: Leaving. 16:18 stamourv: friscosam: Gambit doesn't have a module system. There's a 3rd party one (Black Hole), though. 16:19 stamourv: anonus: I have something lying around. 16:19 anonus: aand? 16:20 stamourv: It doesn't display docs inline, but it makes it possible to look up identifiers in the browser. 16:20 anonus: is it for geiser? 16:20 anonus: browser 16:20 anonus: it is a bit difficult 16:20 stamourv: foof's scheme-complete + eldoc does a bit of inline docs, but mostly for R5 stuff. 16:20 anonus: and geiser cannot into docs for racket? 16:21 stamourv: anonus: It works fine with geiser. It's just a function that finds the identifier under the cursor, launches the browser and searches for the identifier in the docs. 16:21 stamourv: anonus: I haven't looked into geiser much, so I don't know if it does it. 16:21 stamourv: I should post what I have somewhere. 16:21 stamourv tries to figure out how github gists work. 16:21 anonus: ok, so i just need to invent method to run local browser for emacs-over-ssh =/ 16:22 stamourv: Oh, yeah, that could be an issue. 16:22 stamourv: The Racket docs should look fine in w3m, which runs fine through ssh. 16:22 stamourv: So maybe something like that could work. 16:22 anonus: btw i don't believe than no one but me got this problem before 16:23 anonus: i mean running local browser from remote server 16:24 stamourv: anonus: https://gist.github.com/2721375 16:24 stamourv: It's a hack, but it works. 16:26 anonus: interesting 16:32 (join) igibson 16:36 (quit) ynniv: Remote host closed the connection 16:43 (join) lem_e_tweakit 16:53 (quit) dnolen: Ping timeout: 265 seconds 16:56 (quit) kanak: Ping timeout: 252 seconds 17:04 (part) stis 17:05 (quit) dented42: Quit: Computer has gone to sleep. 17:06 (quit) getpwnam: Ping timeout: 244 seconds 17:06 (quit) lem_e_tweakit: Ping timeout: 265 seconds 17:09 shawnps: is there an easy way to collapse a list of lists into one list? like '("foo" '("bar")) -> '("foo" "bar")? 17:09 shawnps: i guess that's not a list of lists necessarily 17:10 (join) yoklov 17:13 shawnps: flatten 17:13 (quit) antithesis: Quit: yes leaving 17:14 shawnps: ah but that doesn't work with pairs 17:15 shawnps: would like to do someting like: '((a . "foo") '((b . "bar") (c . "baz"))) -> '((a . "foo") (b . "bar") (c . "baz")) 17:21 jrslepak: so you want to leave improper lists alone, or just the ends of improper lists, or what? 17:22 jrslepak: also, is that second ' supposed to be there? 17:22 shawnps: from a list that contains pairs and lists of pairs, i'd like to have a list of pairs 17:23 shawnps: i thought i almost had it with this: 17:23 shawnps: (define (foolatten lst) 17:23 shawnps: (cond 17:23 shawnps: ((empty? lst) '()) 17:23 shawnps: ((list? (car lst)) (cons (foolatten (car (car lst))) (foolatten (rest lst)))) 17:23 shawnps: (else (cons (car lst) (foolatten (rest lst)))))) 17:23 (join) nilyaK 17:23 shawnps: actually i can see a couple of mistakes with that 17:24 (join) duncan 17:24 duncan: does anyone know the enitre code for creating an animation where an image moves left right up or down when you hit the corresponding arrow keys 17:24 (nick) duncan -> Guest63637 17:26 (quit) djcb: Remote host closed the connection 17:33 bremner: Guest63637: you should stick around a bit this time 17:34 jrslepak: shawnps: e.g. (foolatten (car (car lst))) ? 17:35 shawnps: jrslepak: yeah, that's wrong isn't it 17:37 jrslepak: well, I have to go now, but you are probably also going to want an append in there rather than cons 17:37 shawnps: hmm, i figured changing that to just (car lst) would work but no 17:37 shawnps: jrslepak: cool, thank you 17:37 jrslepak: remember, flatting a list still leaves you with a list 17:37 jrslepak: *flattening 17:38 (quit) jrslepak: Quit: This computer has gone to sleep 17:39 (quit) jonrafkind: Ping timeout: 265 seconds 17:52 (quit) jeapostrophe: Ping timeout: 240 seconds 17:53 (join) tfb 17:53 (join) jonrafkind 17:56 (join) lem_e_tweakit 17:56 (join) getpwnam 17:57 (join) hash_table 17:57 (join) Quetzalcoatl_ 18:07 (join) peeeep 18:13 friscosam: stamourv: I think blackhole was just starting up around the last time I looked at Gambit seriously. At the time I thought they were trying to do a Planet like system. 18:14 (quit) flying_rhino: Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/ 18:14 danking: shawnps: Shawn Smith? What're you doing in the UK? 18:14 stamourv: friscosam: Could be. Been a while since I looked at it. 18:16 friscosam: yeah, there are so many nice things in Racket that everything else has a high bar to reach ;) 18:16 friscosam: so I don't look at much anymore 18:20 (join) jyc 18:22 (join) RacketCommitBot 18:22 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/hhig_Q 18:22 RacketCommitBot: [racket/master] Pango kerning for Mac OS X - Matthew Flatt 18:22 RacketCommitBot: [racket/master] slideshow/pict: for `text' in caps mode, kern captials with following - Matthew Flatt 18:22 (part) RacketCommitBot 18:25 (quit) tfb: Quit: sleeping 18:32 (join) dnolen 18:43 (quit) nilyaK: Quit: Leaving. 18:46 (quit) mceier: Quit: leaving 18:47 (join) tfb 18:49 (join) jeapostrophe 18:51 (quit) jasoegaard: Ping timeout: 245 seconds 18:55 (quit) jeapostrophe: Ping timeout: 244 seconds 18:55 (join) jeapostrophe 19:07 (quit) yoklov: Quit: computer sleeping 19:08 (quit) jesyspa: Quit: leaving 19:22 (quit) bluezenix: Quit: Leaving. 19:26 (join) dented42 19:29 (join) jacius 19:51 (quit) tfb: Quit: sleeping 19:55 (quit) hash_table: Ping timeout: 245 seconds 19:55 (quit) getpwnam: Ping timeout: 245 seconds 19:56 (quit) lem_e_tweakit: Ping timeout: 272 seconds 20:11 (join) zyoung_ 20:13 (quit) zyoung_: Remote host closed the connection 20:14 (quit) zyoung: Ping timeout: 245 seconds 20:25 (join) zyoung 20:28 (quit) zyoung: Remote host closed the connection 20:29 (join) kvda 20:35 (join) mye_ 20:35 (quit) dnolen: Remote host closed the connection 20:38 (quit) mye: Ping timeout: 272 seconds 20:39 (join) dnolen 20:40 (quit) masm: Quit: Leaving. 20:45 (quit) jonrafkind: Read error: Operation timed out 21:05 shawnps: danking: hi :) i'm not sure why i'm on a UK freenode server, i'm in san francisco as usual 21:06 shawnps: danking: if anything i'd like to be in japan 21:08 (quit) netrino: Quit: Ave! 21:11 (join) cdidd 21:13 (join) mye__ 21:17 (quit) mye_: Ping timeout: 245 seconds 21:17 (quit) jeapostrophe: Ping timeout: 245 seconds 21:20 (join) mye_ 21:23 (quit) mye__: Ping timeout: 240 seconds 21:25 (join) mye__ 21:27 Shambles_: I'm having trouble with part of the Racket Guide. It doesn't discuss contracts with multiple arguments, but no optional or keyword arguments. I'd expect this is the most common case. From what I can gather from the documentation (-> foo? bar/c baz/c) gets read as "this function expects a foo and bar type argument, and returns a baz type one". 21:29 Shambles_: That's all well and good if I only return one argument, which is probably the commonl case, but what happens if you use 'values'? The documentation (Reference, not Guide) mentions the contract has to specify results for each value, but not how this is done. It seems rather difficult since there's no grouping to depict what's input and what's output in the contracts. 21:29 (quit) mye_: Ping timeout: 260 seconds 21:32 offby1: I assume you use ->* 21:32 offby1: let's see. 21:33 offby1: yeah, use (values this/c that/c) in the "range" part. 21:33 offby1: http://docs.racket-lang.org/reference/function-contracts.html?q=-%3E*#(form._((lib._racket/contract/base..rkt)._-~3e*)) 21:33 asumu: rudybot: (contract (-> integer? (values integer? integer?)) (lambda (x) (values x x)) 'pos 'neg) 21:33 rudybot: asumu: your sandbox is ready 21:33 rudybot: asumu: ; Value: # 21:33 asumu: rudybot: (define f (contract (-> integer? (values integer? integer?)) (lambda (x) (values x x)) 'pos 'neg)) 21:33 rudybot: asumu: Done. 21:33 asumu: rudybot: (f 5) 21:33 rudybot: asumu: ; Value: 5 21:33 rudybot: asumu: ; Value#2: 5 21:33 asumu: Like so 21:33 offby1: oh, you don't need ->* 21:33 offby1 makes a mental note 21:33 offby1: on a mental Post-It 21:34 Shambles_: What bothers me is: The ->* contract combinator produces contracts for functions that accept optional arguments (either keyword or positional) and/or arbitrarily many arguments. 21:35 offby1: why does that bother you? 21:35 Shambles_: If I write a function like I usually would, to accept a fixed number of arguments and return a fixed number of values (but more than one!), it sounds like I shouldn't use that. 21:35 offby1: What bothers _me_ is: the refrigerator running loudly at night. Wakes me up 21:35 Shambles_: As for why I care about the multiple values thing... well, Python got me hooked on using it. It's actually pretty darn handy to not have to unpack the things every time. 21:36 offby1: Python doesn't return multiple values, if I recall correctly; but it _does_ let you deconstruct easily. 21:37 Shambles_: Essentially, yes. You can x, y = someFunction(blah) 21:37 Shambles_: Which can be really nice. 21:37 Shambles_: You usually return a tuple. 21:39 Shambles_: So I don't really need ->* ? The documentation is right, it's only for optional or keyword arguments? I can use '(values whatever? here?)' as the end of the contract? 21:39 offby1: *shrug* 21:39 offby1: it's after 5:00 so I don't answer any hard questions. 21:42 (quit) dented42: Quit: Computer has gone to sleep. 21:43 (quit) cdidd: Remote host closed the connection 21:43 (join) jeapostrophe 21:44 (join) nilyaK 21:52 (quit) ambrosebs: Ping timeout: 244 seconds 21:53 asumu: Shambles_: I'm confused. What are you trying to do? 21:53 asumu: ->* is only for optional/keyword arguments. 21:53 Shambles_: How would you write a contract for a function that takes no arguments? Say one you just call to update the screen after you've drawn to a backbuffer. 21:53 asumu: (-> result/c) 21:54 asumu: rudybot: ((contract (-> void?) void 'pos 'neg)) 21:54 rudybot: asumu: Done. 21:54 asumu: rudybot: ((contract (-> integer?) void 'pos 'neg)) 21:54 rudybot: asumu: error: #:1:1: self-contract violation, expected: integer?, given: # contract from: pos, blaming: pos contract: (-> integer?) 21:54 (quit) mye__: Ping timeout: 252 seconds 21:54 asumu: (sorry bad example, but void was the first nullary function to come to mind) 21:55 Shambles_: asumu: I'm trying to understand how to write contracts, working through the guide. There's nothing in the guide for the common case of wanting to accept multiple values, but all values are required. It also doesn't explain contracts for returning multiple values, but offby1 seems to have answered how you do that. 21:55 Shambles_: So I'm guessing the simplest contract would be (-> void?) for a function that takes no arguments and returns nothing? 21:56 asumu: Oh, that's an odd omission. 21:57 asumu: Shambles_: That depends on if you care about the return type. 21:57 asumu: That contract will really enforce that it "does nothing" as opposed to return a string. 21:57 Shambles_: asumu: It's probably easier to notice when you don't already know the material. 21:57 asumu: (-> any) is the simplest contract for a no-argument function, I think. 21:57 asumu: (if you don't care that it's truly void) 21:58 asumu: Also, there are, it turns out, some examples with multiple arguments in 7.4. But yeah, probably better to show one earlier. 21:58 Shambles_: asumu: Yeah, I read about the performance implications of checking void versus using just "any/c". I figure if you're using contracts you've decided it's worth giving up some performance to have reasonable debugging. I like DbC (I'm actually surprised Racket comes with it), and am not one to worry about the overhead for them. 21:59 Shambles_: I'd rather it shout at me for screwing up and returning something. 21:59 asumu: Maybe it's surprising, but Racket had the first higher-order contract system. 22:00 asumu: Yeah, I generally agree with you. 22:00 asumu: I am in a habit of writing (-> any) though I've been writing contracts that go in the core codebase, so I try to make them efficient. 22:00 Shambles_: That is surprising. I figured it'd be one of the ML or Haskell variants. I'm not a big fan of 'fancy' type systems, but I do like contracts. I don't have trouble passing the right type. I do have trouble passing nonsense values at times (and yes, I know you can bludgeon values into types, but you know that's not easy). 22:00 asumu: *though since 22:01 (join) cdidd 22:01 asumu: Some people have come up with contract systems for Haskell, I think. But after Racket. 22:02 Shambles_: It's super awesome to have unit tests blow up your code right where the bug starts, rather than having to stare at it in the debugger, and if you miss something in the unit tests, have it still start the debugger exactly where the problem started, rather than playing detective. 22:02 asumu: Also contracts are not so great with laziness. 22:02 asumu: (you either don't check violations or you break the laziness) 22:03 Shambles_: I wonder if that's true in general? I've used DbC addons in Python, and it works fine with generators, though granted that's a limited example of lazy evaluation. It's a mighty useful example though. 22:05 (join) jrslepak 22:05 asumu: So if you have a lazy sequence (like with a generator) and you attach a contract like (sequence/c integer?) then either 1) you check that every element is an integer? and thus break the laziness 22:05 asumu: or 2) you don't check it until someone requests an element, in which case you may never signal a violation. 22:06 asumu: Unless there's some other case I forgot about. There's a paper reviewing various approaches to this that Haskell people have done. 22:08 asumu: Oh right, there's worse: you can end up blaming the other party due to laziness. 22:09 Shambles_: Python does 2. 22:09 Shambles_: Which I'm okay with really. 22:09 asumu: Since in a fully lazy language, the lazy value might flow somewhere else before its forced. And then might blame some code elsewhere. 22:11 Shambles_: Yeah. I think the 'right place' for contracts is trapping bugs at their origin, rather than as some abstract pointless formalism, or as a full solution to detecting bugs. There won't ever be a full solution to detecting them. The machine can only know what you said, not what you meant. And even for internal-consistency errors there are problems (Godel's incompleteness theorem). 22:12 Shambles_: 2 works pretty well in practice. If the code never blows up during unit testing or during use, it's worth questioning whether the bug 'matters'. 22:13 asumu: Well, I think it'll work fine for a lazy data structure in a strict language. 22:13 asumu: But if the language is lazy too, it might not be forced until way later. 22:13 asumu: In which case, you have lost track of the origin of the bug. 22:14 Shambles_: Assuming the contract implementation works right it should still tell you what the state was, what contract was violated, and what the relevant code was, even if the value doesn't get 'pulled through' when you expect it. 22:15 asumu: Yes, that's true. It just might give you a misleading location. 22:15 Shambles_: Besides, Racket appears to be eager. At least for Racket this stuff isn't a problem, right? 22:16 (join) zyoung 22:16 asumu: Might be an issue for Lazy Racket. But yeah, I was just pondering about Haskell w/ contracts. 22:18 Shambles_: I'm not a big fan of 'default' lazy evaluation, but it is admittedly very handy at times. I wonder if the world will eventually catch on to (hopefully non-default) speculative evaluation. I think it's been around since something like SISAL. 22:29 (join) Demosthenes 22:39 (join) RacketCommitBot 22:39 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/HiTW0Q 22:39 RacketCommitBot: [racket/master] Fix a bug with class/c & interface ctc interaction - Asumu Takikawa 22:39 (part) RacketCommitBot 22:42 (quit) stamourv: Ping timeout: 244 seconds 22:43 (join) stamourv 22:43 (quit) stamourv: Changing host 22:43 (join) stamourv 22:48 (quit) jao: Ping timeout: 240 seconds 23:00 shawnps: so, if i want to use alist->form-urlencoded, i can only have strings as the second element in a pair? something like (alist->formurlencoded '((api_key . (get-pubkey user)) doesn't work :( 23:01 shawnps: er, alist->formurlencoded* 23:01 (join) jonrafkind 23:13 (quit) noelw: Ping timeout: 244 seconds 23:16 asumu: Try `((api_key . ,(get-pubkey user)) 23:16 asumu: (assuming get-pubkey produces a string) 23:16 shawnps: thanks 23:17 shawnps: what does that do? 23:17 asumu: shawnps: it lets you escape from a quotation back into Racket land for a bit and sticks the result into the quoted expression. 23:17 asumu: See http://pre.racket-lang.org/docs/html/guide/qq.html 23:18 (quit) jeapostrophe: Ping timeout: 244 seconds 23:18 asumu: Where ` starts a "quasi-quote" and , lets you escape into Racket. 23:18 shawnps: hmm, that didn't work unfortunately 23:18 asumu: Did it at least give a different error? 23:18 shawnps: string->bytes/utf-8: expects argument of type ; given ',(get-pubkey user) 23:19 asumu: You want ` (backtick) and not ' (quote) 23:19 shawnps: ah! 23:19 shawnps: that worked 23:19 shawnps: thank you :D 23:20 asumu: NP. :) 23:20 shawnps: sorry, i saw you mentioned quasi-quote but hadn't seen you use it before 23:21 (join) getpwnam 23:21 (join) lem_e_tweakit 23:22 (join) hash_table 23:28 (quit) dnolen: Ping timeout: 244 seconds 23:42 (join) nilyaK1 23:45 (quit) nilyaK: Ping timeout: 255 seconds 23:57 (join) dented42 23:59 (quit) stamourv: Ping timeout: 244 seconds