00:08 (join) jeapostrophe 00:08 (quit) jeapostrophe: Changing host 00:08 (join) jeapostrophe 00:11 (quit) mmalorni: Remote host closed the connection 00:13 (quit) jeapostrophe: Ping timeout: 248 seconds 00:14 (join) adu 00:18 (join) mmalorni 00:18 (quit) mmalorni: Remote host closed the connection 00:19 (join) cdidd 00:27 (join) dnolen 00:38 (quit) jonathansizz: Ping timeout: 245 seconds 00:38 (quit) getpwnam: Ping timeout: 260 seconds 00:38 (quit) hash_table: Ping timeout: 260 seconds 00:43 (part) rodolfo 00:50 (join) jeapostrophe 00:50 (quit) jeapostrophe: Changing host 00:50 (join) jeapostrophe 00:53 (quit) clabrie: Ping timeout: 265 seconds 00:56 (join) Kaylin 01:23 (quit) jeapostrophe: Ping timeout: 245 seconds 01:26 (quit) yoklov: Quit: bye! 01:31 (join) jesyspa 01:32 (join) mye 01:36 (quit) kvda: Quit: x__x 01:37 (quit) errstr: Ping timeout: 240 seconds 01:38 (join) errstr 02:34 (quit) mye: Ping timeout: 245 seconds 02:55 (join) netrino 02:58 (quit) jacius: Quit: Leaving 03:07 (join) djcoin 03:07 (join) neilv 03:11 neilv: progedit-file works. http://paste.lisp.org/display/129905 03:12 (quit) adu: Quit: adu 03:13 neilv: i made it pass whatever values returned from read-proc as extra arguments to write-proc. should make it easier to pass parse info without mutations 03:21 (quit) neilv: Quit: Leaving 03:23 (join) adu 03:33 (quit) jonrafkind: Ping timeout: 245 seconds 03:48 Kaylin: okay regexp question, in part of it I want to match a substring that contains neither space, nor @, nor the sequence \r\n (cr-lf)I think I use the negate thing, so [^...] but I don't know what to put in the bracets. 03:49 adu: [^\ @ 03:50 adu: alternatively, learn Perl6 03:52 Kaylin is confused, what's the \ for there? and is the bracket part of the open bracket? 03:58 adu: [^\ @] 03:58 adu: sorry 03:58 adu: missed the end 03:58 adu: the \ is to keep the space there 03:59 adu: otherwise, some regex options would remove it 04:00 Kaylin: ah alright, what if I want a sequence of 2 characters in a row to be negated too? because if I just type those two it'll negate both I think but they're okay as long as they're not in that order 04:00 Kaylin: can I do something like character dot character w/e that operator is 04:02 Kaylin: (I'm playing with racket on IRC so CR-LF is end of message only) 04:03 Kaylin: if that makes sense 04:03 (join) wbook 04:03 Kaylin: like if I type [^\r\n] I don't think that does it 04:04 Kaylin: sorry for so many questions, I've completely confused myself reading the documentation and such. 04:07 (quit) adu: Quit: adu 04:08 Kaylin: :( 04:09 (join) RacketCommitBot 04:09 RacketCommitBot: [racket] plt pushed 4 new commits to master: http://git.io/6lWejQ 04:09 RacketCommitBot: [racket/master] improve cycle-in-loading error message - Matthew Flatt 04:09 RacketCommitBot: [racket/master] `local-expand' allows a stop list to have only `module*' - Matthew Flatt 04:09 RacketCommitBot: [racket/master] scribble: fix duplicate call to `render-element' callback - Matthew Flatt 04:09 (part) RacketCommitBot 04:33 Cryovat: Kaylin: I'm only experienced with .NET and Java regexes, but 04:33 Cryovat: There should be a way to match the beginning and the end of a line 04:34 Cryovat: I.e. "^.*?$" in .NET (in multiline mode) would match a single line 04:34 Kaylin: yea ^ matches the start of a line 04:34 Kaylin: if it's not used in [] 04:34 Kaylin: otherwise it's negate 04:36 Kaylin: but like for example the fragment [^@ ] seems to be neither "@" nor "space", but [^@ /r/n] would be neither @ nor space nor carriage return nor linefeed, which isn't what I want that part to do I want it to be neither @ nor space nor the sequence /r/n 04:36 Kaylin: if that makes any sense 04:37 Cryovat: Does the Racket regex support lookahead and lookbehind? 04:37 Cryovat: I guess in that case you could use beginning and end of line markers inside those 04:38 Kaylin: hmm, idk :O 04:44 Kaylin: http://docs.racket-lang.org/reference/regexp.html#%28elem._%28rxex._33%29%29 is this example what you mean? I'm not entirely sure how it works but yea. 04:44 rudybot: http://tinyurl.com/84nsnyn 04:44 Kaylin: I think I need to think about this again when it's not so late but I will try it for sure 04:52 (join) clabrie 05:06 (quit) clabrie: Quit: leaving 05:07 (join) chemuduguntar 05:11 chemuduguntar: hi all 05:12 Kaylin waves. 05:16 chemuduguntar: Kaylin: :) 05:20 (join) chandler_ 05:20 (quit) chemuduguntar: Ping timeout: 248 seconds 05:21 (join) ozzloy_ 05:21 (quit) chandler: Remote host closed the connection 05:23 (quit) antono: Ping timeout: 260 seconds 05:24 (quit) basepi: Ping timeout: 260 seconds 05:30 (join) basepi 05:34 (quit) dnolen: Ping timeout: 244 seconds 06:02 (join) nilyaK 06:03 (quit) Kaylin: Quit: Leaving. 06:23 (join) antono 06:40 (quit) nilyaK: Quit: Leaving. 07:01 (join) chemuduguntar 07:12 (join) wwb 07:13 (quit) wbook: Read error: Network is unreachable 07:22 (join) masm 07:44 (join) dzhus 08:05 (quit) chandler_: Changing host 08:05 (join) chandler_ 08:05 (nick) chandler_ -> chandler 08:15 (quit) Shviller: Ping timeout: 245 seconds 08:16 (join) Shviller 08:26 (quit) wwb: Quit: Leaving 08:32 (quit) BeLucid: Read error: Connection reset by peer 08:33 (join) BeLucid 08:55 (join) jonathansizz 08:55 (join) getpwnam 08:56 (join) hash_table 09:29 (join) mmalorni 09:32 (quit) mmalorni: Remote host closed the connection 09:32 (quit) jonathansizz: Ping timeout: 245 seconds 09:32 (join) mmalorni 09:32 (quit) hash_table: Ping timeout: 245 seconds 09:32 (quit) getpwnam: Ping timeout: 245 seconds 09:40 (join) dented42_ 09:41 (quit) dented42: Read error: Connection reset by peer 09:41 (nick) dented42_ -> dented42 09:52 (quit) chemuduguntar: Ping timeout: 244 seconds 09:53 (quit) maahes: Ping timeout: 244 seconds 09:59 (quit) antono: Ping timeout: 260 seconds 10:00 (join) jeapostrophe 10:00 (quit) jeapostrophe: Changing host 10:00 (join) jeapostrophe 10:01 (join) maahes 10:09 (join) snearch 10:13 (quit) djcoin: Quit: WeeChat 0.3.2 10:13 (join) djcoin 10:17 (join) mceier 10:39 (join) gciolli 10:42 (join) getpwnam 10:42 (join) jonathansizz 10:43 (join) hash_table 10:45 (join) dnolen 10:45 (quit) snearch: Quit: Verlassend 10:46 (join) snearch 10:57 (quit) Mungojelly: Quit: Make it idiot proof and someone will make a better idiot. 11:00 (join) ravi` 11:02 (join) adu 11:27 (quit) jrslepak: Quit: This computer has gone to sleep 11:29 (quit) dnolen: Ping timeout: 245 seconds 11:42 (quit) mmalorni: Remote host closed the connection 11:52 (join) samth 11:52 (quit) samth: Changing host 11:52 (join) samth 11:52 (join) samth_ 11:52 (quit) samth_: Client Quit 11:56 (join) antono 11:57 (join) gridaphobe 12:11 (quit) noelw: Quit: noelw 12:16 (join) anRch 12:17 (quit) jonathansizz: Ping timeout: 244 seconds 12:17 (quit) hash_table: Ping timeout: 244 seconds 12:17 (quit) getpwnam: Ping timeout: 244 seconds 12:21 (quit) djcoin: Quit: WeeChat 0.3.2 12:23 (quit) tim-brown: Remote host closed the connection 12:27 (quit) adu: Read error: Connection reset by peer 12:27 (join) adu 12:37 (quit) jeapostrophe: Ping timeout: 245 seconds 12:48 (quit) noam: Read error: Connection reset by peer 12:49 (quit) anRch: Quit: anRch 12:49 (join) noam 12:51 (join) jonrafkind 12:51 (quit) jonrafkind: Changing host 12:51 (join) jonrafkind 13:04 (join) __rahul__ 13:07 (join) getpwnam 13:07 (join) jonathansizz 13:08 (join) hash_table 13:10 (quit) noam: Read error: Connection reset by peer 13:10 (join) noam 13:19 __rahul__: Hi all, is there something in racket analogous to the chicken scheme statistics library? 13:21 (join) antithesis 13:22 (nick) ozzloy_ -> ozzloy 13:22 (join) dzhus89 13:22 jonrafkind: __rahul__, maybe this? http://planet.racket-lang.org/package-source/williams/science.plt/4/6/planet-docs/science/index.html 13:22 rudybot: http://tinyurl.com/6nvozjl 13:22 (join) ozzloy 13:23 (quit) dzhus: Ping timeout: 245 seconds 13:24 __rahul__: thanks for the reference 13:24 __rahul__: is there a library somewhere with simple combinatorics like permutations and combinations 13:29 Shambles_: I've been studying how to write macros more and was wondering if there was anything wrong with doing compile time evaluation this way: http://paste.lisp.org/display/129914 13:29 Shambles_: The example I was given used a let, rather than placing the variables directly in the body of the addition. I'm not sure if eliminating that would do any harm. 13:31 (quit) netrino: Ping timeout: 244 seconds 13:31 Shambles_: I know the version I pasted works, at least. 13:32 (part) gciolli 13:33 jonrafkind: that should work 13:36 (join) jeapostrophe 13:36 (quit) jeapostrophe: Changing host 13:36 (join) jeapostrophe 13:42 Shambles_: jonrafkind: Some of the stuff I've learned has to do with improving error reporting. Apparently that's the reason for using quasisyntax/loc Removing the let won't mess anything up? 13:42 jonrafkind: no, the let is just so you don't evaluate an argument twice 13:43 jonrafkind: but you are only using A and B once anyway, so it doesnt matter 13:43 jonrafkind: you could imagine if you did (sqrt (+ A A) (+ B B)) that if A was some complicated expression it would do a lot of needless work twice 13:43 Shambles_: jonrafkind: Okay. Thanks. :) 13:44 (join) netrino 13:53 (quit) __rahul__: Read error: Connection reset by peer 13:55 (join) mye 14:05 (join) anRch 14:06 (join) __rahul__ 14:09 (join) mye_ 14:12 stamourv: Shambles_: Re types for positive, negative, non-zero numbers, etc.: Typed Racket supports these, and some range-bounded types (`Fixnum', `Index', `Byte', etc.) too. 14:12 stamourv: You can use these to get more checking than with `Integer' and co. 14:13 (quit) mye: Ping timeout: 265 seconds 14:13 Shambles_: stamourv: I'm glad my memory isn't totally shot so I know what you were referring to. What I meant is if you just program with 'integer', to placate the code generator, which is what I've always done (C habit, and anything else doesn't buy you much in C or C++), the types don't help much other than for performance. 14:15 Shambles_: stamourv: I still find using type systems inconvenient to use for error checking. You end up having to make types like positive-integer-power-of-two (e.g. for a dimension of a texture in a game). Some people like them though, I know. 14:21 Shambles_: stamourv: I guess to be a bit more thorough that'd be positive-integer-power-of-2-greater-than-or-equal-to-8-and-less-than-or-equal-to-4096. I'm thinking of that C++ program I was working on, whose libraries only worked with textures with those qualties. You'd get graphical corruption or crashes otherwise, and yes, bugs involving that did actually happen. You can see how that'd be awkward though, I think. 14:22 Shambles_: stamourv: Sometimes only one of those properties is important (e.g. 'positive'). You get a type-explosion when you start having to deal with all the combinations. That's why I like contracts. You can just say what the code expects at a given point, and it reads a lot like the documentation for the input and output of the function. 14:23 stamourv: It's always a tradeoff between what you check statically, and what you check dynamically. 14:24 stamourv: You could check everything statically, but at that point, you're in dependent type land, where hard things are impossible and easy things are research papers. 14:24 stamourv: I think Typed Racket is a practical middle ground. 14:25 Shambles_: stamourv: Yeah. There's a lot of ways to do the static checking. Type systems are just one of them. They're one the machine can check relatively quickly and reliably (except for dependent types). In my opinion (which doesn't count for much, I know) anything beyond what's needed for efficent code generation exacts a price too high for something that isn't sufficient for full formal verification. 14:26 (quit) BeLucid: Ping timeout: 260 seconds 14:26 Shambles_: stamourv: If you do want to go nuts and run your code through ACL2 or something similar, contracts help a lot more than types (assuming they aren't equivalent, again like dependent types). 14:28 stamourv: Well, everything's a type system if you squint hard enough. See also: everything's just abstract interpretation. 14:28 Shambles_: stamourv: You don't have to go nuts with formal verification using contracts though. Most everybody just uses them to ease debugging. And if you really don't like them, you can ignore them, which isn't the case with a lot of languages with 'fancy' type systems. 14:29 stamourv: True. The pay-as-you-go-ness is a big plus. 14:29 (join) Kaylin 14:29 Shambles_: stamourv: Agreed about everything being types. 14:30 stamourv: I'm not sure I agree with that myself. 14:30 stamourv: I mean, yes, it is, but it's not a very useful observation. 14:30 (nick) samth -> samth_away 14:32 Shambles_: stamourv: If you use it to mean things like "every programming language is statically type checked, but some just have one type" yes, it's pretty dumb. Used to mean what most people mean, it's more useful. Obviously if the functions that passed the texture codec libraries returned only things of positive-integer-power-of-2-greater-than-or-equal-to-8-and-less-than-or-equal-to-4096 we would have had less bugs. 14:32 Shambles_: stamourv: And I'm convinced, with great pain, it could have been done that way. 14:33 (quit) __rahul__: Quit: Leaving 14:35 Shambles_: stamourv: Passed the dimensions to the texture codec etc etc rather. 14:55 (quit) jonrafkind: Ping timeout: 245 seconds 15:00 danking: stamourv: Everything's just a flow analysis. 15:02 stamourv: danking: See also: everything's just abstract interpretation. 15:02 stamourv: ;) 15:03 stamourv: Flow analysis is just abstract interpretation. 15:03 stamourv: But I guess everything is, so... 15:03 stamourv finds the Cousot tarpit amusing. 15:04 (quit) Kaylin: Quit: Leaving. 15:06 (quit) noam: Read error: Connection reset by peer 15:06 (join) noam 15:07 asumu: Next the tarpit tarpit. 15:07 (join) jtpercon 15:07 stamourv: rudybot: (let ([x 1]) (lambda (x) (if (eq? x 'inc) (set! x (add1 x)) x))) 15:07 rudybot: stamourv: your sandbox is ready 15:07 rudybot: stamourv: ; Value: # 15:07 stamourv: Oops. 15:07 stamourv: rudybot: (define f (let ([x 1]) (lambda (x) (if (eq? x 'inc) (set! x (add1 x)) x)))) 15:07 rudybot: stamourv: Done. 15:07 stamourv: (f) 15:07 stamourv: rudybot: (f) 15:07 rudybot: stamourv: error: procedure f: expects 1 argument, given 0 15:08 stamourv: rudybot: (f 0) 15:08 rudybot: stamourv: ; Value: 0 15:08 stamourv: rudybot: (f 'inc) 15:08 rudybot: stamourv: error: add1: expects argument of type ; given: 'inc 15:08 stamourv: Oops, shadowing. 15:08 stamourv: rudybot: (define f (let ([x 1]) (lambda (y) (if (eq? y 'inc) (set! x (add1 x)) x)))) 15:08 rudybot: stamourv: Done. 15:08 stamourv: rudybot: (f 'inc) 15:08 rudybot: stamourv: Done. 15:08 stamourv: (f 0) 15:08 stamourv: Gah. 15:08 stamourv: rudybot: (f 0) 15:08 rudybot: stamourv: ; Value: 2 15:08 stamourv: asumu: ^ 15:09 asumu: Yeah, that's a reasonable thing to do. I was thinking of something else. 15:19 (nick) dzhus89 -> dzhus 15:22 danking: rudybot: (begin-for-syntax (define-struct just-a-function ([l #:mutable] r) #:property prop:procedure 2) (define (define#-help proc) (let* ((me (box #f)) (f (just-a-function proc (lambda args (apply (just-a-function-l (unbox me)) args))))) (set-box! me f) (values f (lambda (new-proc) (set-just-a-function-l! f new-proc)))))) 15:22 rudybot: danking: your sandbox is ready 15:22 rudybot: danking: error: make-struct-type: index for procedure >= initialized-field count: 2 15:23 danking: rudybot: (begin-for-syntax (define-struct just-a-function ([l #:mutable] r) #:property prop:procedure 1) (define (define#-help proc) (let* ((me (box #f)) (f (just-a-function proc (lambda args (apply (just-a-function-l (unbox me)) args))))) (set-box! me f) (values f (lambda (new-proc) (set-just-a-function-l! f new-proc)))))) 15:23 rudybot: danking: Done. 15:23 danking: rudybot: (define-syntax define# (syntax-rules () ((_ ((name magic) args ...) body) (define-values (name magic) (define#-help (lambda (args ...) body)))))) 15:23 rudybot: danking: Done. 15:23 danking: rudybot: (define# ((foo magic) x) (sqr x)) 15:23 danking: rudybot: (foo 9) 15:23 danking: rudybot: (magic sqrt) 15:23 danking: rudybot: (foo 9) 15:23 rudybot: danking: error: reference to an identifier before its definition: define#-help in module: 'program 15:23 rudybot: danking: error: reference to an identifier before its definition: foo in module: 'program 15:23 rudybot: danking: error: reference to an identifier before its definition: magic in module: 'program 15:23 rudybot: danking: error: reference to an identifier before its definition: foo in module: 'program 15:24 (quit) noam: Read error: Connection reset by peer 15:25 (join) noam 15:26 danking: rudybot: (begin (define-struct just-a-function ([l #:mutable] r) #:property prop:procedure 1) (define (define#-help proc) (let* ((me (box #f)) (f (just-a-function proc (lambda args (apply (just-a-function-l (unbox me)) args))))) (set-box! me f) (values f (lambda (new-proc) (set-just-a-function-l! f new-proc)))))(define-syntax define# (syntax-rules () ((_ ((name magic) args ...) body) 15:26 rudybot: danking: whatever you want to do; you should try (set! global-proc new-proc), where new-proc can be a lambda 15:28 danking: I don't really have a clear agenda here. 15:32 (join) jao 15:33 (quit) jao: Changing host 15:33 (join) jao 15:52 (join) samth 15:52 (quit) samth: Changing host 15:52 (join) samth 15:55 (join) mye 15:57 (quit) snearch: Quit: Verlassend 15:58 (quit) mye_: Ping timeout: 252 seconds 16:12 (join) jorick 16:13 jorick: Hi! I have a question about how to structure my programs with modules. But I'm not sure how to put it exactly. I'm trying to create a website using racket... there's not really a lot of frameworks available so I'm rolling my own but I'm running into troubles with these cyclic dependencies. 16:15 jorick: Basically what I want to do is recreate the TiddlyWiki like it is in http://www.antipope.org/charlie/blog-static/fiction/accelerando/toughguide.html 16:15 rudybot: http://tinyurl.com/26k8sx4 16:16 jorick: (well it's somewhat like that) 16:17 jorick: I have all the HTML, CSS and JS ready, but I cant figure out how to structure the backend. 16:17 asumu: How are you getting cyclic dependencies? 16:19 jorick: well; for instance... I have a function called claim! which is: key -> wildcard -> controller. It's supposed to register the controller to be run by the request handler whenever the incoming path matches the wildcard. 16:19 jorick: so I can use this function in plugins, which will supply the controller function etc... 16:20 stamourv: If you're doing plugins, you may want to look at units. 16:20 stamourv: rudybot: doc define-unit 16:20 rudybot: stamourv: http://docs.racket-lang.org/reference/linkinference.html#(form._((lib._mzlib%2Funit..rkt)._define-unit)) 16:21 jorick: I mean I just don't know what I'm doing, really, so I just figured I'd create a config.rkt file which would require all these plugins. But then the plugins need the config.rkt to get the actual configuration so I got stuck 16:21 jorick: okay I'll look at that; thanks :) 16:21 stamourv: That's what DrRacket uses for its plugin system. 16:21 stamourv: That, and mixins. 16:22 asumu: Another solution is to go higher-order. Have config.rkt provide a function that takes your plugin and install it. 16:23 asumu: That way only the config.rkt file needs to know how to apply a configuration to your plugin. 16:23 asumu: (that might be too abstract to be useful, but there are lots of ways of doing this) 16:26 jorick: Initially; that was also what I was thinking... I could just have config.rkt export a list of plugins that ought to be loaded by the bootstrap. but I got put off by the idea of having to deal with importing a module a by name etc... seemed like that ought to be a solved problem already 16:26 jorick: guess it is 16:29 (quit) jesyspa: Ping timeout: 246 seconds 16:29 (quit) samth: Ping timeout: 256 seconds 16:30 (join) jesyspa 16:32 (quit) jao: Quit: ERC Version 5.3 (IRC client for Emacs) 16:32 (join) jao 16:36 (quit) anRch: Quit: anRch 16:43 (quit) jao: Ping timeout: 260 seconds 16:57 (quit) antithesis: Quit: antithesis 16:58 (join) jao 17:03 (join) Kaylin 17:04 (quit) jao: Ping timeout: 252 seconds 17:18 (quit) cdidd: Remote host closed the connection 17:19 (part) jtpercon 17:31 (join) jao 17:32 (quit) jao: Changing host 17:32 (join) jao 17:33 (quit) netrino: Quit: Ave! 17:33 (quit) mye: Ping timeout: 244 seconds 17:36 (quit) jorick: Remote host closed the connection 17:48 (join) jrslepak 17:48 (quit) jrslepak: Remote host closed the connection 17:49 (join) jrslepak 17:50 (quit) jeapostrophe: Ping timeout: 265 seconds 17:51 (quit) Kaylin: Quit: Leaving. 17:57 (join) dnolen 18:02 (quit) ravi`: Ping timeout: 252 seconds 18:04 (join) jonrafkind 18:04 (quit) jonrafkind: Changing host 18:04 (join) jonrafkind 18:05 (join) dented42 18:07 (join) neilv 18:17 (quit) jao: Remote host closed the connection 18:26 (join) mungojelly 18:27 (join) jao 18:27 (quit) jao: Changing host 18:27 (join) jao 18:31 (quit) jesyspa: Quit: leaving 18:31 (join) ozzloy_ 18:31 (join) cataska_ 18:36 (quit) basepi: *.net *.split 18:36 (quit) ozzloy: *.net *.split 18:36 (quit) cataska: *.net *.split 18:36 (quit) wtetzner: *.net *.split 18:36 (quit) Shvillr: *.net *.split 18:36 (quit) Nisstyre: *.net *.split 18:36 (join) basepi 18:37 (join) Shvillr 18:39 (nick) ozzloy_ -> ozzloy 18:42 (join) ssbr_ 18:42 (join) wtetzner 18:44 (join) Nisstyre 18:45 (quit) adu: Quit: adu 18:47 (join) surrounder 18:48 neilv: > progedit-file: contract violation, expected a procedure that accepts 2 arguments and arbitrarily more without any keywords, given: 18:48 neilv: oo, i didn't know it englishified 18:52 neilv: in contracts, how do i say "proc accepting at least 2 argument, possibly more" rather than "proc accepting 2 arguments and arbitrarily more"? 18:54 (join) jules2 18:54 neilv: looks like "->*" doesn't do it. "->i" looks even more painful; perhaps that will do it 18:56 jules2: I have the following code in typed racket: http://pastebin.com/wS43pGNv I get the error that pair? results in a filter (Pairof Any Any), but it expected filter (Pairof A (Listof A)) Is there a way to fix this? 19:00 jules2: Perhaps the problem is that pair? has type Any -> Boolean : (Pairof Any Any) whereas the type needed here is forall A,B. Any -> Boolean (Pairof A B)? 19:03 jules2: hmm, no, that would not be a sensible type for pair?. 19:06 (join) jeapostrophe 19:06 (quit) jeapostrophe: Changing host 19:06 (join) jeapostrophe 19:09 (join) jacius 19:13 asumu: neilv: what's the difference between arbitrarily more and possibly more? 19:13 neilv: i believe "arbitrarily more" requires the procedure to accept an arbitrary number of arguments 19:18 asumu: neilv: Oh, I see. I think that's not something the contract system supports right now. 19:18 asumu: And something that we've talked about adding. 19:21 (quit) jeapostrophe: Ping timeout: 248 seconds 19:22 neilv: well, it's an unusual case, but considering how scary and big the contracts documentation is, i'm a little surprised this is not handled already 19:22 neilv: i'll just use "procedure?" for now 19:47 Shambles_: jules2: Since nobody more knowledgeable has responded, I'll take a vague stab at this. Before you listen to me, realize I know nothing about Typed Racket. 19:47 jules2: that's okay, you probably know a lot more than me :) 19:47 Shambles_: jules2: First, it sounds like you're trying to reimplement something that already exists in Racket. That's generally a bad idea unless somebody else is making you do it (e.g. for class). 19:48 jules2: right, I was just doing it to explore how typed racket works 19:49 Shambles_: jules2: Second, pair? would be expecting a "cons cell" (something I do actually understand, I think), which really is a car (a.k.a. first, or head), and a cdr (a.k.a rest, or tail). I wouldn't be too surprised by it expecting a list. 19:51 Shambles_: jules2: I do know you can have a 'dotted pair' where the second part isn't a list, so that might not necessarily be the right type. 19:51 Shambles_: jules2: This part looks suspicious, if you're getting odd type behavior: (define-type (FullList A) (Pair A (List A))) 19:51 jules2: well, a list is basically a cons cell where the cdr is a list, or nil. the problem here appears to be that the type information from pair? doesn't get intersected with the type information on xs 19:52 jules2: what's suspicious about that? i'm trying to define the type of non-empty lists 19:54 Shambles_: jules2: I thought perhaps the type system was getting its notion of what a pair constituted from there. 19:54 (quit) mceier: Ping timeout: 244 seconds 19:55 jules2: nope, it's not like in haskell/ocaml: Pair is defined elsewhere. It's the type of built-in cons cells. 19:55 Shambles_: jules2: Admittedly this looks more like Haskell than what I'm used to seeing, even in the skimming I've done of Typed Racket. I have no idea what the :: notation is supposed to do. Usually a colon separates a identifier and its type, I know. I understand the arrow is the range -> domain (input -> output) notation. 19:56 jules2: the :: notation is just a name I used for my version of cons, you can substitute "foo" for "::" and it doesn't change (i.e. it's just a name, nothing special to typed racket) 19:57 jules2: admittedly it does look a bit confusing in the type signature (: :: ...) ;) 19:58 (quit) masm: Quit: Leaving. 19:58 jules2: the single colon is from typed racket, however 19:58 (quit) neilv: Quit: Leaving 19:59 Shambles_: jules2: I gather the other : are to separate the types of things. It looks like you're saying "the type of isfull? is (List A) -> Boolean : (FullList A)" 19:59 jules2: exactly 20:00 jules2: a type X -> Boolean : Y defines a predicate on things of type X, and the : Y indicates that if the predicate returns true then typed racket will deduce that X has type Y 20:00 Shambles_: Where does this "All (A)" come in, and what is the meaning of the "Boolean : (FullList A)"? I'd expect isfull? to return a boolean, but I don't know why the stuff after and including the colon is there. 20:01 jules2: so you can do for example (if (number? x) (+ x 1) ...) without a type error, because typed racket can deduce that in the then-clause x has type number 20:01 jules2: (All (A) ...) defines a universally quantified type, like forall A. ... in Haskell 20:02 bremner never used forall in Haskell. Isn't it mostly implicit? 20:02 Shambles_: I see, so ... mmm, my type theory is (blessedly) rusty. That ":" after the Boolean is akin to the horizontal line in type theory, meaning "therefore it's a (FullList A)" then? 20:02 jules2: my intention in this case is to make this type check: (if (isfull? x) (head x) ...) where x has type List 20:03 jules2: something like that, yes 20:03 jules2: bremner, yes in Haskell it's mostly implicit. lowercase variables in types are implicitly universally quantified afaik 20:03 Shambles_: What would change about the definitions of your types if you removed the All (A)? 20:03 Shambles_: As in how does the meaning change, since I'm rather confused about how that changes anything. 20:04 jules2: Well for example in the type of head: (All (A) ((FullList A) -> A)), if you removed the All then you'd be left with ((FullList A) -> A), and that would be ill-scoped because there is no A in scope 20:05 Shambles_: I see. So it gives you a A to use as "list of anything"? 20:05 jules2: you could define it like this: (: head (FullList Number) -> Number), but then it would only work on numbers 20:05 jules2: yes 20:05 jules2: basically (All (A) ... A ...) is an infinite intersection of ... A ... over all possible types A 20:06 jules2: so for example (A -> A) is both (Number -> Number) and (String -> String) 20:06 jules2: correction: (All (A) (A -> A)) 20:07 Shambles_: Okay, well, the good news is once you get past the nasty syntax in most type notation, the way they actually work is pretty simple. It's just a chain of deductions starting with the basic facts. 20:08 Shambles_: Lemme see if I can figure out why it expects a (Pairof A (Listof A)) 20:09 jules2: I think it expects that because I defined isfull? with : (FullList A) and (FullList A) is the same as (Pairof A (Listof A)) 20:10 Shambles_: So the line I pasted at first probably is the problem? 20:12 jules2: well, I think the problem is that I was expecting typed racket to (correctly) deduce a stronger type than it currently does 20:12 Shambles_: I'm also looking at the definition above it. I can almost read it I think. It looks like its saying a list is defined recursively as a union of null or a pair containing a head and a list. 20:13 jules2: but perhaps there is a way to convince typed racket of the type correctness of the isfull? definition 20:13 jules2: yes, exactly 20:14 Shambles_: I'm wondering if that definition is correct. 20:14 (quit) jschuster: Ping timeout: 255 seconds 20:14 Shambles_: Does it handle the case of a list of 1 correctly? 20:14 jules2: I think so, because there is no problem with the ::, head and tail functions 20:14 (quit) jrslepak_neu: Ping timeout: 248 seconds 20:15 Shambles_: I suppose the recursive definition would just decide that the list was null in the 1 item case then. 20:16 jules2: what do you mean? 20:17 (join) jschuster 20:18 (join) jrslepak_neu 20:18 Shambles_: I'm not used to reading these kinds of definitions. I personally would have expected the notation to say something like "a pair is either null (a empty list), or contains a head item, and a null or list for the tail item". 20:19 Shambles_: But perhaps it does what it should. I don't do Haskell. It just sounds to me like one of your type definitions is wrong. 20:19 Shambles_: And the types of both of those definitions 'look like' the symptom you're getting. 20:20 Shambles_: As in, specifically expecting a list, not just a pair of anythings. 20:23 Shambles_: On a different note, given you've defined the arguments and return value, is there any real benefit to the ": (FullList A)" on isfull? Can Typed Racket use that information elsewhere somehow? 20:23 jules2: a pair is not null, a pair is a pair 20:23 jules2: the definition is saying this: 20:23 jules2: a list of A is (1) a pair of A and list of A or (2) Null 20:24 jules2: examples of lists: 20:24 jules2: Null 20:24 jules2: (Pair Number Null) 20:24 jules2: (Pair Number (Pair Number Null)) 20:24 jules2: etc. 20:25 jules2: the benefit of : (FullList A) is that if you use isfull? in an if expression: 20:25 jules2: (if (isfull? xs) THEN ELSE) 20:25 jules2: then you can use (head xs) and (tail xs) within the THEN clause 20:26 (quit) acarrico: Ping timeout: 252 seconds 20:26 jules2: normally you can't just use (head xs) on a normal (List A) because the type of head says that it only works on FullLists (that is, on non-empty lists) 20:26 jules2: which makes sense, because an empty list doesn't have a first element 20:27 Shambles_: jules2: So it effectively 'coerces' a list to being a FullList? 20:27 jules2: yes, but in a type safe way 20:27 Shambles_: jules2: Like a conditional type cast? 20:28 Shambles_: jules2: That's a interesting idea. 20:28 Shambles_: jules2: Sorry I'm not more help. I'm surprised nobody else has said anything by now. 20:29 Shambles_: jules2: Seems like samanth is the one you'd be looking for? I think that's the one that maintains Typed Racket. 20:30 jules2: yes 20:30 jules2: i might ask again tomorrow 20:32 Shambles_: jules2: I last saw them talking around 3pm EDT (GMT -5:00) I think. That might be a good time to try. 20:33 jules2: ah, I don't think i'll be up that early; it's 2:30 here now, and I'm going to sleep soon and I'll sleep longer than 2,5 hours ;) maybe another time 20:34 jules2: oh, GMT -5, I read that as: 3pm EDT is 5am GMT 20:34 Shambles_: jules2: Well, that's 3 in the afternoon (using the 12 hour style clock, not 24 hour military time), here on the Eastern Coast. 20:34 Shambles_ randomly upcases some words, leading people to believe the Eastern Coast is a country. :P 20:35 (join) RacketCommitBot 20:35 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/wG2vkQ 20:35 RacketCommitBot: [racket/master] In addition to providing "provide", I also provide several of its - Stephen Bloch 20:35 (part) RacketCommitBot 20:37 jules2: Shambles_, oh, I fixed the problem: http://pastebin.com/rQQm5gKF 20:37 jules2: now I feel stupid -.- 20:37 Shambles_: jules2: Yeah, the GMT -5:00 thing was to let you know my time zone. Here in the US they'd just call it EDT, but I doubt that means anything outside the US. Basically I'm 5 hours behind whatever time it is in Greenwich, England. 20:38 Shambles_: jules2: Don't. :P At least you get along with the complex type systems. 20:38 jules2: yup, so 3pm ECT is 8pm GMT I think 20:38 jules2: a reasonable time 20:40 jules2: sorry, this is the correct version: http://pastebin.com/7EYFDMvL 20:40 Shambles_: The code looks pretty different from your previous. I don't even see some of the same function definitions now. 20:40 jules2: apparently it does not like eta-reduction 20:40 jules2: yes, it turns out all those definitions were unnecessary 20:41 jules2: basically, Pair and Listof are built into typed racket (TR) 20:41 jules2: so we can define a non-empty list as (Pair A (Listof A)) 20:41 jules2: and then we redefine safefirst to just be the same as first, but with a more restrictive type: (FullListof A) instead of (Listof A) 20:42 jules2: so now we are only allowed to call safefirst in places where TR knows that the list is not empty 20:42 Shambles_: Oh I'd expect most all of this is built into Typed Racket. I mean, it's Lisp, with static type checking. They're not going to not have properly typed basic functions like pair? 20:43 jules2: and as it turns out, TR is smart enough to deduce that in (if (pair? somelist) (safefirst somelist) ...), the somelist has to be non-empty due to the pair? check 20:43 Shambles_: I'm guessing your if test down there displays 1, instead of 3? 20:43 jules2: yes 20:44 Shambles_: I remember reading it did type inference and whatnot, so I suppose that's not too surprising. 20:44 jules2: yes, that's a correct expectation, but somehow I thought it was made a difference to introduce all those custom definitions 20:44 jules2: it does some type inference yes 20:44 jules2: well actually it doesn't do type inference in the academic sense of the word afaik, but it does type inference in the C# var and C++ auto sense 20:45 Shambles_: I remember hearing it doesn't support classes. I wonder how much of the normal Racket struct features it supports, given supposedly type inference and OO do not mix well. 20:45 jules2: so it lets you omit the type in (let ) expressions 20:45 Shambles_: Cobra basically makes you specify the types by hand when OO gives it trouble, or just defaults to dynamic type checking in those cases. 20:46 jules2: it does support structs fully 20:47 Shambles_: Inheritance and all? 20:47 jules2: do structs support inheritance? 20:47 Shambles_: jules2: Yep. That's why I was so confused at Racket having both structs and classes. Structs seem to support *almost* everything classes do. 20:48 Shambles_: jules2: They are, for all intents and purposes, conventional OO classes. 20:48 Shambles_: jules2: inheritance, constructors, methods, and all. 20:49 Shambles_: jules2: The reason this doesn't play well with type inference is it can make it hard to decide what, exactly, the broader type should be, when there's multiple candidates. At least if memory serves. 20:50 jules2: yea, but I don't think that's a problem for typed racket because it doesn't do global type inference 20:50 Shambles_: jules2: And if you can overload methods it gives the type inference system a headache. If memory serves that's why the ML variations didn't want to do that. 20:51 Shambles_: jules2: Because it normally depends on them to determine the likely types of things. 20:52 Shambles_: jules2: Yeah, it's probably doing it like Cobra does. If memory serves the way it worked is whatever you initialized a variable as, that's what its type was from then on. 20:52 jules2: TR does support structs with inheritance (just tested it) 20:54 jules2: example here: http://pastebin.com/8vQ9FQsh 20:56 asumu: TR does do type inference. It's local type inference and not a Hindley-Milner style system ala ML or Haskell. 20:56 Shambles_ nods. "I guess the thing keeping GUI's from working is the class macros haven't been ported, or something. I've been trying to wade through the Syntax: Meta-Programming Helpers documentation. That's the only way I knew they were macros." 20:58 jules2: asumu, can you give an example of how you can use type inference? 20:59 Shambles_: I'd assume you just don't specify the type of something, and it 'figures it out'. That's the way it usually goes. 20:59 (join) neilv 21:00 Shambles_: jules2: I take it you usually can't get it to accept functions without giving the type signature? 21:00 jules2: yes, for the things I've tried it says that a type signature is missing 21:01 Shambles_: I have no idea then. 21:03 asumu: rudybot: init typed/racket 21:03 rudybot: asumu: your typed/racket sandbox is ready 21:03 asumu: rudybot: (: fact (Integer -> Integer)) 21:03 rudybot: asumu: Done. 21:03 asumu: rudybot: (define (fact n) (let loop ([n n] [acc 1]) (if (zero? n) acc (loop (- n 1) (* n acc))))) 21:03 rudybot: asumu: Done. 21:04 asumu: rudybot: (fact 5) 21:04 rudybot: asumu: ; Value: 120 21:04 rudybot: asumu: ; stdout: "- : Integer\n" 21:04 asumu: I didn't annotate two bindings and it inferred them. 21:04 asumu: rudybot: (define s "hello") 21:04 rudybot: asumu: Done. 21:04 jules2: cool! 21:04 asumu: rudybot: (:t s) 21:04 rudybot: asumu: error: #:1:1: Type Checker: untyped top-level identifier :t in: :t 21:04 asumu: rudybot: (:type s) 21:04 rudybot: asumu: error: #:1:7: Type Checker: Unbound type name s in: s 21:04 asumu: rudybot: (:print-type s) 21:04 rudybot: asumu: ; stdout: "String\n" 21:05 asumu: It inferred the type of `s` 21:05 jules2: hmm, is that really type inference? 21:05 jules2: isn't that just top-down type deduction that is happening with type checking anyway? 21:06 jules2: for example if I have a function of type String -> ..., then if I call (f "hello") then it has to deduce that "hello" is of type String anyway 21:07 Shambles_: I think that's about the extent Cobra and C# do it. The practical aspect was primarily that it kept you from having to type as much (pun intended). I know it didn't let you specify anything 'fancy', or do extra bug checking. 21:08 jules2: I don't think C# can infer asumu's previous example with the loop 21:09 asumu: It's just a simple example of inference, I'd say. 21:09 jules2: well, actually C# can. I was thinking of loop in terms of a recursive function definition 21:10 asumu: Also, TR infers some instantiation of polymorphic type parameters. 21:10 jules2: i used to think that type inference always involves some kind of constraint solving, rather than type deduction; apparently that's not how it's defined 21:11 Shambles_: jules2: I think so. Cobra and C# seemed to have about the same limitations there, but there was less syntax in Cobra (it's basically optionally statically typed Python, with contract support, and eliminates the null pointer problem). It wasn't particularly impressive. You pretty much had to define the types by assignment somewhere, you just didn't have to type out "int" (or whatever) in front of most things. 21:12 (quit) dnolen: Remote host closed the connection 21:12 asumu: jules2: If often does, but here's a quote from an abstract on local type inference: "Local type inference determines types by a combination of type propagation and local constraint solving, rather than by global constraint solving." 21:12 Shambles_: While it wasn't 'fancy' it was nice for the convenience. 21:13 jules2: right, I was just skimmin that paper. It seems quite similar to what C#/Java type checkers were already doing 21:16 jules2: I'm going to bed. Thanks for the help and for the conversation in general :) 21:16 Shambles_: Sweet dreams. 21:16 (quit) jules2: Quit: Leaving 21:20 (part) mungojelly: "ERC Version 5.3 (IRC client for Emacs)" 21:23 (quit) gridaphobe: Remote host closed the connection 21:32 (join) dnolen 21:39 (join) mmalorni 21:43 (quit) ashish: Quit: Whenever we are together, it’s always estatically palpitating! 21:44 (join) ashish 21:49 (quit) mmalorni: Ping timeout: 260 seconds 21:50 (quit) dnolen: Ping timeout: 245 seconds 21:50 (join) jeapostrophe 21:50 (quit) jeapostrophe: Changing host 21:50 (join) jeapostrophe 22:01 (quit) jeapostrophe: Ping timeout: 260 seconds 22:10 (join) jeapostrophe 22:10 (quit) jeapostrophe: Changing host 22:10 (join) jeapostrophe 22:16 (quit) jeapostrophe: Ping timeout: 256 seconds 22:23 (quit) dented42: Ping timeout: 244 seconds 22:24 (join) dented42 22:32 (join) mmalorni 22:35 (quit) dented42: Ping timeout: 244 seconds 22:57 Shambles_: I found a typo on http://docs.racket-lang.org/syntax/stxparse-patterns.html "Like an ellipses (...) pattern, but requires at one occurrence of the head pattern to be present." 22:57 Shambles_: It should read "Like an ellipses (...) pattern, but requires at least one occurrence of the head pattern to be present." 23:03 jonrafkind: ok i fixed it for you, ill push the commit sometime 23:04 Shambles_: jonrafkind: I may not be much good for anything, but I can spot stuff like that. Hopefully it helps some. 23:04 jonrafkind: the idea at one point was to make the docs page somehow editable so users could change stuff and it would propagate back to the developers 23:05 jonrafkind: but that idea hasn't taken hold yet 23:05 Shambles_: jonrafkind: You'd have trouble with spammers and trolls if you did that anyway. 23:05 jonrafkind: well it could use a captcha like the bug system 23:06 Shambles_: jonrafkind: That'd help with the spammers some, but now they pay people in third world countries to bypass that. And it won't help with trolls. Usually takes a few near-full-time folks to keep a wiki under control. 23:13 (quit) jonrafkind: Ping timeout: 244 seconds 23:14 (join) dented42 23:15 asumu: A middleground would be to only give accounts to vetted people. 23:15 asumu: Or if the doc edits generated something like a pull request. 23:15 asumu: (so that there's some review) 23:19 Shambles_: asumu: That'd be best yes. 23:20 Shambles_: asumu: I wouldn't go with the typical 'everybody can edit everything' approach. 23:45 (join) vu3rdd 23:45 (quit) vu3rdd: Changing host 23:45 (join) vu3rdd 23:52 vu3rdd: Hello Racketeers 23:53 vu3rdd: I am trying out Typed Racket using the TR guide on Racket built from latest git. 23:53 vu3rdd: I get type error on the first program in the guide 23:53 vu3rdd: http://pre.racket-lang.org/docs/html/ts-guide/beginning.html 23:53 vu3rdd: Type Checker: Expected Real, but got Number in: (sqrt (+ (sqr (- (pt-x p2) (pt-x p1))) (sqr (- (pt-y p2) (pt-y p1))))) 23:58 vu3rdd: this is the first time I am using Typed Racket..