00:21 (quit) realitygrill: Ping timeout: 244 seconds 00:21 (join) realitygrill 00:53 (quit) francisl: Quit: francisl 00:55 (join) carleastlund 01:06 (quit) dnolen: Quit: dnolen 01:22 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/L3v2Vg 01:22 RacketCommitBot: [racket/master] Fixed a bug with small (but not epsilon) flonum bounds - Neil Toronto 01:22 RacketCommitBot: [racket/master] Started icon reorganization - Neil Toronto 01:47 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/cVgykw 01:47 RacketCommitBot: [racket/master] Doc fixes and better examples (because black icons are kewl) - Neil Toronto 01:54 (quit) freakazoid: Quit: Computer has gone to sleep. 01:54 (quit) SidH_: Quit: Leaving 02:14 (quit) carleastlund: Quit: carleastlund 02:16 (quit) EmmanuelOga: Ping timeout: 244 seconds 02:34 (join) freakazoid 02:41 (join) rrandom 02:48 (quit) jonrafkind: Ping timeout: 244 seconds 02:55 (quit) rrandom: Quit: Page closed 03:12 (quit) realitygrill: Quit: realitygrill 03:59 (join) Shvillr_ 03:59 (quit) Shviller: Disconnected by services 03:59 (nick) Shvillr_ -> Shviller 04:01 (quit) Shvillr: Read error: Connection reset by peer 04:02 (join) Shvillr 04:27 (join) dirtyjack 04:28 (quit) dirtyjack: Client Quit 04:32 (quit) mithos28: Quit: mithos28 04:34 (join) masm 04:42 (quit) freakazoid: Quit: Computer has gone to sleep. 05:19 (quit) loz`: Read error: Connection reset by peer 05:48 (join) didi 05:57 (join) ahinki 06:26 (join) Blkt 06:39 (quit) Pauan: Ping timeout: 244 seconds 06:54 (join) Pauan 07:17 (quit) mario-goulart: Remote host closed the connection 07:17 (join) mario-goulart 07:45 (quit) Lajla: Ping timeout: 252 seconds 07:49 (join) EmmanuelOga 08:03 (join) francisl 08:27 (join) fridim_ 08:42 (join) realitygrill 08:46 (quit) francisl: Quit: francisl 08:51 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/Ta78hA 08:51 RacketCommitBot: [racket/master] Increasing timeout - Jay McCarthy 09:30 (quit) sethalves: *.net *.split 09:36 (join) sethalves 10:25 (nick) samth_away -> samth 10:27 (join) Shvillr_ 10:27 (quit) Shviller: Disconnected by services 10:27 (nick) Shvillr_ -> Shviller 10:27 (quit) Shvillr: Ping timeout: 245 seconds 10:28 (join) Shvillr 10:38 (quit) didi: Ping timeout: 248 seconds 10:48 (join) anRch 10:52 (join) tyson1 10:56 (part) tyson1 10:57 (quit) realitygrill: Quit: realitygrill 11:04 (quit) ahinki: Quit: ChatZilla 0.9.87 [Firefox 9.0/20111122192043] 11:08 (join) dingfeng 11:10 (join) xfr954 11:11 dingfeng: hi 11:11 ozzloy: hey 11:11 ozzloy: eli, sorry to aggravate you about the regex syntax 11:12 ozzloy: syntax/semantics 11:12 samth: ozzloy: you shouldn't think that eli is aggravated -- he's like that always :) 11:12 ozzloy: oic 11:13 (join) dnolen 11:13 ozzloy: samth, do you know what he means by separating the syntax problem from the semantics problem? 11:13 Pauan: ozzloy: I'm working on it from a different approach: a Reader macro in Racket to just do a simple conversion 11:13 ozzloy: Pauan, cool cool 11:13 Pauan: so #px/\n/ will translate to #px"\n" 11:13 samth: ozzloy: israelis have a way of being direct :) 11:14 ozzloy: and #px/\d/ will translate to #px"\\d"? 11:14 Pauan: yes 11:14 ozzloy: Pauan, yeah, that's what i plan on doing too 11:14 samth: ozzloy: he means that there are two proposals -- being able to match different stuff, and how you write it 11:14 Pauan: that is true, but... 11:14 Pauan: you already *can* match them 11:15 Pauan: it's just that the way it's designed is such that matching some things require a single \ and some require two \s 11:15 ozzloy: samth, so there is currently stuff you can't match with racket regexps? 11:15 Pauan: thus I consider it mostly a syntax problem 11:16 (join) realitygrill 11:17 ozzloy: or something? 11:18 Pauan: (only thing I know off the top of my head is obscure Unicode stuff like \\X and the alternate syntax for \\u{E0}) 11:18 Pauan: (but in practical terms, Racket's regexps offer plenty of functionality) 11:19 ozzloy: it would be kinda lame to have 3 syntaxes for regexes in racket 11:19 ozzloy: so that's unfortunate 11:19 Pauan: yeah, but what can ya do? 11:19 Pauan: you can't use something like "raw strings" 11:19 Pauan: because Racket converts strings into regexp, not pregexp 11:19 Pauan: (unless you made it confusing and said that regexp functions would use pregexp for raw strings and regexp for normal...) 11:22 ozzloy: if this were SPARTAA! i'd just drop the current #rx and #px and replace with #rx/normal regex syntax where \d matches a digit and \\d matches a backslash followed by the letter d/ 11:22 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/SJf4VQ 11:22 RacketCommitBot: [racket/master] Set props on icons and render-png.rkt - Neil Toronto 11:23 samth: ozzloy: yeah, eventually we'll build a new language which can be redesigned from the ground up 11:23 samth: but for now, it grows by accretion 11:24 ozzloy: i would think with lisps in particular, this sort of thing would be relatively easy 11:25 ozzloy: you could have automatic static conversion from one version to the next for source files, and dynamic translation for libs that haven't been updated yet 11:25 (join) jeapostrophe 11:25 ozzloy: but that's me sitting in my armchair 11:26 Pauan: okay, got backslash slash working: #px/\// 11:26 Pauan: now for things like \n 11:27 ozzloy: i'm all in favor of the #px"" behavior of erroring when it encounters an unknown escape 11:27 ozzloy: Pauan, so this is a reader macro? 11:27 Pauan: yeah 11:27 Pauan: written in Racket 11:27 ozzloy: can i see? 11:28 Pauan: when it's in a halfway presentable state, yes :P 11:28 ozzloy: bah, i should go back to ai 11:28 Pauan: it'll take some massaging to get it to work nicely with the existing syntax, though 11:28 ozzloy: i keep drifting into this topic 11:29 Pauan: because we want to add on #px/ while still enabling #px" 11:29 ozzloy: Pauan, wait, did you abandon the c changes? 11:29 Pauan: they're still sitting on my harddrive 11:29 ozzloy: icic 11:29 Pauan: but I didn't make any progress since I added in the basic escapes 11:29 Pauan: (I actually have not programmed in C at all :D) 11:29 Pauan: (but it doesn't look too hard to pick it up) 11:29 ozzloy: yeah, it's a small language 11:30 Pauan: I HAVE programmed a lot in JS 11:30 Pauan: and the syntax is familiar enough 11:30 ozzloy: js is lisp with c syntax 11:30 Pauan: ^ 11:30 Pauan: and without macros! 11:30 ozzloy: yeah, also that 11:30 Pauan: which is probably the hugest diss to JS 11:31 Pauan: JS with macros would actually be a pretty cool language 11:31 Pauan: despite its warts 11:31 Pauan: at least you could use macros to mend the warts 11:31 ozzloy: at least the worst part of racket so far is "wah, i have to have too many double escapes in regexps! waah" 11:31 dingfeng: has anyone tried writing racket code that generates js code? (without translating from bytcode) 11:32 Pauan: already been done: whalesong 11:32 ozzloy: dingfeng, i think whalesong is that 11:32 Pauan: http://hashcollision.org/whalesong/ 11:32 Pauan: (hell, there's even an Arc to JS compiler... in fact I think there's at least 2 of them, and Arc interpreters written in JS... and Arc is I believe a far newer language than Racket...) 11:33 dingfeng: i thought whalesong translates it from the bytecode level... 11:33 Pauan: (just about any respectable language has a JS runtime/compiler now, Haskell, clojure, Racket, Python, Java...) 11:33 Pauan: not sure, never used whalesong 11:34 ozzloy: js is the new assembly 11:34 Pauan: yes, exactly 11:34 Pauan: or I guess it'd be more like the new C 11:34 Pauan: then again... 11:35 dingfeng: it's like the new scheme without TRO? 11:35 Pauan: ECMAScript Harmony wants to add that in, though 11:36 Pauan: http://wiki.ecmascript.org/doku.php?id=harmony:proper_tail_calls 11:36 ozzloy: so to confirm in my mind, the semantics problem with racket's regexps is the lack of some escapes like \X and \u{e 11:36 ozzloy: er... 11:36 (quit) xfr954: Quit: Leaving 11:36 Pauan: yeah, but we didn't really discuss those 11:36 ozzloy: \u{e0} 11:37 Pauan: so I don't think eli was talking about that 11:37 Pauan: I think he really was talking about things like "\\n" and "\\t", though I may be wrong on that 11:38 ozzloy: oh, also if this was SPARTAA! i'd call them "regex". notice there's no 'p' in it. i'd like to keep it that way. 11:39 ozzloy: especially for english. two voiceless phonemes at the end of a word? a fricative followed by a stop? unacceptable! 11:40 (quit) si14: Excess Flood 11:42 ozzloy: Pauan, so it's currently not clear to you what semantics problem he was talking about 11:43 Pauan: yeah, and I also think it was rather confusing to call it "string syntax" since Racket already has strings... which use a different syntax from regexps... 11:43 ozzloy: but you think it was how #rx"\\n" is interpreted 11:43 Pauan: but I think it became pretty clear that he and I are using different terminology 11:43 Pauan: yes, that's what I think 11:44 Pauan: (almost got the basic escapes working, by the way) 11:45 ozzloy: woo 11:45 Pauan: (now just to tackle \x and \u and it should be golden) 11:45 Pauan: (also to get #px" working) 11:45 (join) si14 11:45 ozzloy: have fun with that 11:46 ozzloy: i'm really off to ai now 11:46 Pauan: okay 11:46 (quit) realitygrill: Ping timeout: 244 seconds 11:46 (join) realitygrill 11:52 (quit) anRch: Quit: anRch 11:55 (join) jonrafkind 11:56 eli: ozzloy: What made you think I was aggravated? 11:57 eli: ozzloy: And re the name, (a) "two voiceless phonemes" isn't a problem, since it's coming from the ones in "expression", which also makes it easy to pronounce (just don't say the "ression" part); (b) "regexp" is more established in places that I know about, which are mostly in lisp circles; (c) it's not that important. 12:01 (join) anRch 12:08 (join) RackN00b 12:08 RackN00b: Pauan - are you around by any chance? 12:08 Pauan: yes 12:09 RackN00b: Hey! I got everything working nicely this morning - yay! Now I am writing a nice challenging backtracking function to find solutions but it just dawned on my that if there are not at least 5 contiguous blanks in a given puzzle, there is no possibility of a solution... O you think it would be hard to write a predicate function to check that? 12:10 Pauan: as in... 12:10 Pauan: ((#\. #\. #\.) (#\. #\. #\.)) would return #t 12:10 (join) anRch_ 12:10 Pauan: but ((#\T #\T #\.) (#\. #\. #\.)) would return #f? 12:11 (quit) anRch: Read error: Connection reset by peer 12:11 (nick) anRch_ -> anRch 12:11 RackN00b: Correct... I know how to do a total count - I just flatten the list, and that'd a valid pre-check but I would also like to check to ensure the blanks are contiguous... 12:11 RackN00b: Might be tricky... 12:11 Pauan: okay, and by contiguous you mean in either the x or y axis? 12:12 RackN00b: Yes... such that at least one of the pentaminoes could fit into it... 12:12 Pauan: so ((#\. #\. #\. #\. #\.) (#\T #\T #\T #\T #\T)) would be #t 12:12 Pauan: but ((#\. #\. #\. #\. #\T) (#\T #\T #\T #\T #\T)) would be #f? 12:13 RackN00b: correct... but ((#\. #\. #\. #\. #\T) (#\T #\T #\. #\T #\T)) would also be true... I think the fact that the grid are represented by lists make this quite challengeing. 12:13 Pauan: ah, so it accepts it in hm... 12:13 Pauan: okay, so 12:13 Pauan: that only matters in grids that are greater than 3 12:14 RackN00b: Correct... 12:14 Pauan: er, greater than 2* 12:14 Pauan: okay, one last question 12:14 RackN00b: esp 12:14 RackN00b: yes rather 12:14 Pauan: ((#\. #\. #\. #\.) (#\T #\T #\T #\T) (#\T #\T #\T #\.)) 12:14 Pauan: should be #f? 12:15 Pauan: but this: 12:15 Pauan: ((#\. #\. #\. #\.) (#\T #\T #\. #\T) (#\T #\T #\T #\T)) 12:15 Pauan: should be #t? 12:15 RackN00b: Correct 12:15 Pauan: okay then 12:15 Pauan: I'll get to work on that after I get this reader macro working 12:15 RackN00b: cheers - it's tricky methinks 12:16 Pauan: well, *any* problem is tricky the first time you do it 12:16 RackN00b: hah this is true 12:24 (quit) anRch: Quit: anRch 12:25 (join) mithos28 12:37 (join) MayDaniel 12:42 Pauan: okaaaay, finally got the reader macro working 12:42 Pauan: everything seems in order 12:43 Pauan: so I can get started on your request 12:43 RackN00b: good stuff 12:43 (quit) MayDaniel: Read error: Connection reset by peer 12:43 RackN00b: Here's the other thing I realized... There is the possibility of having more than one instance of a contiguous 5-blank space... 12:44 Pauan: does it matter? 12:44 Pauan: as soon as it finds a match, that should be enough, right? 12:44 RackN00b: yes, that's correct. 12:45 Pauan: hm... 12:45 Pauan: what about this here? 12:45 Pauan: ((#\T #\T #\. #\.) (#\T #\T #\. #\.) (#\T #\T #\T #\.)) 12:45 Pauan: should that be #t? 12:46 RackN00b: Yes 12:46 Pauan: (worst case scenario it'll be quadratic, by the way) 12:46 Pauan: (which is still quite bad) 12:46 RackN00b: eeek 12:46 Pauan: hm... 12:46 Pauan: might be more than quadratic... 12:47 Pauan: why do you need this? is it just a check for performance? 12:47 (join) freakazoid 12:47 RackN00b: No, I' like to eliminate unsolvable puzzles from the list of possible puzzles I need to backtrack on... 12:47 Pauan: so... for performance? :P 12:48 RackN00b: Sorry, yes, it would be - otherwise, I'd be checking every orientation and every offset for every given pentomino on an unsolvable puzzle.. 12:48 Pauan: okay, well 12:49 Pauan: since the function should have a (hopefully) small constant, even if that constant is applied quadratically 12:49 Pauan: it should hopefully still be faster to apply the predicate first 12:49 RackN00b: That's what I was hoping, yeah 12:49 Pauan: (by the way, to show how I'm tackling the problem) 12:49 Pauan: I'm first mapping the blank? function onto the lists 12:50 RackN00b: I see 12:50 Pauan: so (contiguous? '((#\. #\.) (#\T #\T))) returns ((#t #t) (#f #f)) 12:50 Pauan: now I'm gonna play around with some other stuff to see if I can get it to detect contiguousness in the x axis 12:50 Pauan: (contiguousness in the y axis is easy, of course) 12:50 RackN00b: I would have imagine that should return just false, not another list...? 12:51 Pauan: it will 12:51 RackN00b: I see 12:51 Pauan: but until I've figured out a good way to sort it out 12:51 RackN00b: Oh, sthat's the mapping, right 12:51 Pauan: I'm building it up step my step 12:53 Pauan: aaand I turn to recursion again... it's pretty much what I do whenever there's not a higher-order function available 12:53 Pauan: I love recursion 12:53 RackN00b: me too 12:53 Pauan: hm 12:54 Pauan: what about the puzzle ((#\. #\. #\. #\. #\.)) ? 12:54 Pauan: a single column of 5 blanks 12:54 Pauan: I'm guessing that'd be #t 12:54 RackN00b: true 12:56 Pauan: hm... 12:56 Pauan: this could be tricky 12:56 Pauan: especially because columns may not be equal width 12:56 RackN00b: They would be equal width. 12:56 Pauan: hm 12:56 Pauan: so a puzzle is always guaranteed to be uniform? 12:56 RackN00b: It's always a 5x12 grid 12:57 Pauan: ah, okay 12:57 Pauan: that makes it easier 12:57 (quit) mithos28: Quit: mithos28 13:03 Pauan: (this is a situation where I prefer car and cdr to return null on the empty list rather than error) 13:05 RackN00b: Yeah, that's fine... 13:23 (quit) masm: Ping timeout: 248 seconds 13:27 Pauan: looks like I've done it 13:28 Pauan: lemme just run over the tests real fast 13:28 (join) mithos28 13:29 Pauan: hm... 13:29 Pauan: they all pass except for this one... 13:31 Pauan: ugh, and fixing it will be hacky 13:31 Pauan: oh well 13:31 RackN00b: I'm curious to see how you did this! 13:31 Pauan: lots of recursion :P 13:31 Pauan: also using xcar and xcdr because there is absolutely no way I am writing this algorithm without them 13:32 Pauan: car and cdr throwing an error on null is crazy with this kind of stuff 13:32 RackN00b: haha yep 13:33 Pauan: okay, final test passes 13:33 Pauan: and the code is done in a way that I'm satisfied with 13:33 RackN00b: wow 13:33 Pauan: just gonna put in a few more tests 13:34 Pauan: then I'll get it over to you 13:34 RackN00b: Cool 13:35 samth: Pauan: why would car and cdr need to produce a value for `null'? 13:35 Pauan: well, the way this works is it's recursing nested lists 13:35 Pauan: and the number of sublists are variable 13:35 Pauan: so having to put in "null?" checks everywhere is a huge pain 13:35 Pauan: for this particular algorithm 13:36 Pauan: other recursive algorithms aren't so bad 13:36 Pauan: but this particular one is... ugh 13:36 RackN00b: haha 13:36 Pauan: basically, it's recursing down 2 lists in parallel 13:36 samth: i'm having trouble imagining this program where the null checks are a problem 13:36 Pauan: where the right list might be null 13:36 Pauan: so every iteration within the loop 13:36 Pauan: calls cdr on both the left list and the right list 13:36 Pauan: but the right list might be null, as said 13:37 Pauan: so there would probably be at least 5 or so null checks 13:37 Pauan: without using xcdr 13:37 samth: so what do you get from the `car' of an empty list? 13:37 Pauan: the empty list 13:37 samth: and why is that sensible? 13:37 Pauan: in this particular algorithm? makes the code way shorter, WAY less verbose, way less boilerplate, and easier to understand 13:38 Pauan: whether it's a good idea in general... I'm not gonna debate that right now 13:38 samth: Pauan: can you post the code somewhere? 13:38 samth: i'm still skeptical 13:38 Pauan: sure 13:39 Pauan: okay, tests done, now to upload 13:40 (join) anRch 13:41 Pauan: RackN00b, samth: http://pastebin.com/j9CFD93J 13:41 Pauan: the definition of blank? is the same as before, it's included for completeness but you can remove it 13:42 Pauan: basically, see how it calls (loop (xcdr l) (xcdr r) ...)? 13:42 Pauan: it's recursing down two lists in parallel 13:42 Pauan: in this case, l and r 13:42 Pauan: but when it processes the last list in the grid, r will be null 13:42 (quit) dnolen: Ping timeout: 265 seconds 13:42 RackN00b: Nice! I'll test it out with some full puzzles - gotta rewrite the lets and loops first... might be a while before I get back to you :) 13:42 Pauan: I'd really rather not have to write (if (null? r) (cdr r) null) 13:42 Pauan: every time where I put (cdr r) 13:42 Pauan: so I use xcdr, which does the check for me 13:43 RackN00b: Neat 13:43 Pauan: er... 13:43 Pauan: (if (null? r) null (cdr r)) 13:43 Pauan: oh, and, no clue about the time complexity of the algorithm, but it should hopefully be fairly fast 13:43 Pauan: faster than trying every offset at least 13:44 Pauan: why do you need to rewrite the let loop? 13:46 RackN00b: Can't use it at my language level... 13:46 Pauan: so... 13:46 Pauan: ...they allow you to use "local" but not "let"? 13:46 Pauan: that seems... bizarre 13:46 RackN00b: yep...weird 13:46 Pauan: especially since I'd imagine that "let" would be far more common in code than "local"! 13:46 Pauan: I got the impression that "local" isn't used very often 13:47 samth: Pauan, RackN00b: `local' is much simpler than `let' if you already know `define' 13:47 Pauan: but you can just use "define" inside a function body... 13:47 Pauan: that'll behave like a local define 13:47 samth: not in the student languages 13:47 Pauan: hm 13:47 Pauan: they changed the behavior of the language? 13:47 Pauan: odd 13:47 samth: yes 13:47 samth: the student languages are quite restricted, for multiple reasons 13:47 Pauan: okay, restrictions I can understand 13:48 Pauan: but I'd still expect "let" to be taught 13:48 Pauan: like 13:48 Pauan: the basic version 13:48 samth: local binding is taught, using `local' 13:48 Pauan: for defining a variable: (let ([a 5]) a) 13:48 samth: the point of the class isn't to teach the features of Racket 13:48 samth: RackN00b: where are you a student? 13:49 RackN00b: University of Waterloo 13:49 Pauan: sure, but I'd still expect "let" in any Lisp programming language class 13:49 samth: Pauan: you can do that just fine w/ local: (local [(define a 5)] a) 13:49 Pauan: never said you couldn't 13:49 Pauan: but "let" is more readable 13:49 samth: Pauan: HtDP is not a Lisp programming language class 13:49 samth: it's a programming class that uses a lisp dialect as the vehicle 13:49 Pauan: RackN00b: I can do the local transformation for you, but since I'm using full Racket, I can't guarantee the result will work, you'll need to check it 13:50 RackN00b: If you ahve time, that'd be awesome, but don't worry about it if not... I don't know if I will get the whole thing done by 8pm anyway so :P.... Spent too much time working on the bonuses and I have yet to start making any headway on my neighbours function that generates all possible combinations of puzzles/pieces remaining... 13:51 (quit) fridim_: Ping timeout: 245 seconds 13:52 samth: Pauan: about your code 13:52 (join) fridim_ 13:52 Pauan: yes? 13:52 samth: i find it very hard to understand -- what are the various functions supposed to be doing? 13:52 Pauan: input is a list of lists 13:52 Pauan: where #\. is a blank spot 13:52 samth: what do r l n seen top and num represent 13:52 Pauan: and anything else is a block 13:53 Pauan: l is the left-most list currently being processed, r is the list immediately to the right 13:53 Pauan: n is the number of contiguous non-blank spaces seen so far in the grid 13:53 Pauan: and seen is whether a non-blank space has been seen or not 13:53 samth: what's the overall purpose statement for the function? 13:53 Pauan: it's searching a 2D grid for 5 contiguous blank spaces 13:53 Pauan: (where the 2D grid is a list of lists) 13:54 Pauan: for instance, in this 1D grid: 13:54 Pauan: ((#\. #\. #\T #\. #\. #\.)) 13:54 Pauan: there are 2 contiguous blank spaces, followed by a #\T 13:54 Pauan: followed by 3 more contiguous blank spaces 13:55 Pauan: that's less than 5, so the function contiguous? returns #f 13:55 Pauan: in the 1D grid ((#\. #\. #\. #\. #\.)) however 13:55 Pauan: there are 5 contiguous blank spaces 13:55 Pauan: but it gets tricky when you have a 2D grid 13:55 samth: Pauan: i think there's a bug 13:55 samth: try this: (contiguous? '((#\. #\T #\. #\.) (#\. #\. #\. #\T) (#\T #\T #\T #\T))) 13:56 Pauan: hm... 13:56 Pauan: that does seem to be a bug, yes 13:56 Pauan: I'll fix that 13:56 Pauan: right, RackN00b? 13:56 Pauan: shouldn't the above return #t? 13:56 RackN00b: It should, yes 13:56 Pauan: kay, I'll fix that, then 13:58 samth: i really think your program would be easier to understand without trying to treat everything as infinitely nestable lists 13:58 Pauan: probably 13:59 samth: the 2d structure of the data isn't reflected in your program at all, except for the `top' boolean parameter 13:59 Pauan: except... this doesn't really allow for infinitely nested lists either 13:59 Pauan: only a 2D grid 13:59 Pauan: though it does allow for infinite dimensions in this grid 13:59 Pauan: how would you suggest to write it, then? 14:00 RackN00b: Hey guys... can someone quickly check some code - it's not terminating and I can't figure out why... I need to have the flatgrid defined locally since it will change depending on the grid fed to it... http://pastebin.com/ihGesWph 14:01 RackN00b: It's not-terminating but I can't figure out why... The binding of flatgrid is higher level so it should be recursing on that list, no? 14:01 Pauan: hm 14:02 Pauan: well 14:02 Pauan: first off 14:02 Pauan: you don't actually need flat-grid as a variable 14:02 RackN00b: nevermind... the parameter name for the local function 14:02 (quit) freakazoid: Quit: Computer has gone to sleep. 14:02 RackN00b: I don't ?! 14:03 Pauan: yeah, because blank-count accepts a parameter: grid 14:03 Pauan: so just change all instances of flatgrid to grid 14:03 Pauan: and then move the local variable flat-grid into the initial call to blank-count 14:03 RackN00b: Ifyep but then recursing over it, it expects a grid 14:04 Pauan: no, because it doesn't actually call "grid" at all 14:04 Pauan: (unless that's just unimplemented functionality) 14:04 Pauan: if you want it to have access to the *original* grid, then you can just change blank-count's variable name 14:05 (join) freakazoid 14:05 Pauan: http://pastebin.com/qS2y0Djb 14:05 RackN00b: I don't need the actualy grid, just the flattened version - it's for a check number of empties type predicate 14:05 Pauan: try that 14:05 Pauan: dunno if it'll terminate or not 14:05 Pauan: but at least it's cleaner 14:05 RackN00b: Yeah makes sesne! facepalm! 14:09 Pauan: okay, fixed the bug in contiguous-count 14:11 Pauan: http://pastebin.com/j9CFD93J 14:11 Pauan: thanks to samth for spotting the bug 14:11 Pauan: I also changed it to use local rather than a let loop 14:11 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/s2FroA 14:11 RacketCommitBot: [racket/master] Finished icons docs, renamed racket-icon-style to default-icon-style - Neil Toronto 14:11 Pauan: it's a very mechanical transformation 14:15 (quit) realitygrill: Quit: realitygrill 14:16 RackN00b: wow 14:17 Pauan: I just tweaked it a little to remove xcar and xcdr for the l variable, since they're not needed. Also fixed a bug 14:17 Pauan: refresh the page to get the newest version 14:17 RackN00b: ok 14:19 (join) realitygrill 14:20 Pauan: (another tiny tweak) 14:20 Pauan: did that function I give you earlier terminate? 14:21 (join) masm 14:21 RackN00b: sure did 14:21 Pauan: great, great 14:22 Pauan: it was probably a problem with the locals definition, then 14:22 Pauan: I suspect locals behaves like let and not let* 14:22 Pauan: but then again... hm... 14:22 Pauan: in any case, as long as it works 14:22 RackN00b: It does... I will have to carefully look at tit to make sure I know what's going on... 14:24 Pauan: ozzloy: here it is, in all its crude glory: http://pastebin.com/0rp9xrtP 14:24 Pauan: not the prettiest bunch of code in the world, but it seems to work just fine, and even handles odd corner cases and throws errors when given non-hexidecimal escapes 14:25 Pauan: you should be able to plop that into a Racket module, require the module, and bam now you have #px/.../ syntax, while still leaving #px"..." working. I didn't do it for #rx/.../ since I think that's kinda silly, but I could add it in if desired 14:26 Pauan: if anybody knows of a better way to add in a reader macro, or if I'm just horribly terribly wrong, I'd appreciate if you'd tell me 14:27 samth: Pauan: you might want to look at peek-char 14:27 samth: to alleviate the ew in that code 14:27 Pauan: it uses peek-char... 14:27 Pauan: the ew is that it needs to fallback for #px"" 14:27 Pauan: and peek-char only peeks one character 14:27 Pauan: but I need it to peek 2 14:28 Pauan: hm... 14:28 Pauan: peek-char does have a skip-byte offset... 14:29 Pauan: but that's bytes, not chars 14:29 Pauan: might be good enough for this situation, though 14:29 Pauan: (if it worked on chars rather than bytes, it'd be perfect) 14:33 Pauan: hm... 14:34 Pauan: the offset works, but I *still* can't use read/recursive because it needs to append #p to the front, but right now it's only appending p... 14:35 Pauan: yeah, don't think that'll work 14:35 Pauan: nice suggestion, though 14:37 (join) DanBurton 14:40 samth: Pauan: can't you just call `read', get back a string, and then pass that to pregexp? 14:41 Pauan: well, yes, I could 14:41 Pauan: but I'd be relying on the current behavior of the reader syntax 14:41 Pauan: if the syntax changes behavior, or if new syntax is added 14:41 Pauan: mine'll still work 14:42 samth: true 14:43 Pauan: (I agree it is very clunky, though, and I'd like to get rid of it) 14:44 Pauan: one option at least would be to throw an error in the case of it not being / or " 14:44 Pauan: I'd still be relying on the current semantics of the #px" staying the same 14:44 Pauan: but that's unlikely to change because of backwards compat 14:45 Pauan: I think that's an okay compromie 14:45 Pauan: compromise* 14:45 samth: yes, i think so too 14:45 Pauan: hm... 14:46 Pauan: yeah, I'll just go that route 14:46 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/SPyHeA 14:46 RacketCommitBot: [racket/master] change the framework & drracket so that they still use the colorer - Robby Findler 14:46 RacketCommitBot: [racket/master] adjust the handling of the scheme mode keymap so that it can go - Robby Findler 14:51 (quit) si14: Ping timeout: 245 seconds 14:52 Pauan: now with less ew: http://pastebin.com/0rp9xrtP 14:52 Pauan: thanks for that, samth 15:02 samth: Pauan: i think you could you peek-char for the #\x and #\/ and then use the `start' argument to `read/recursive' to prepend #\# 15:02 Pauan: no 15:03 Pauan: because it needs to prepend #\# #\p 15:03 Pauan: two characters 15:03 Pauan: otherwise I totally would 15:03 Pauan: so my only option for prepending 2 characters is to use the awful input-port-append I was using before 15:04 Pauan: (keep in mind, the reader-macro is a dispatch-macro, which means the inital #\# character is implied) 15:04 Pauan: (so this reader macro actually matches the sequence #p) 15:05 samth: right, i know 15:06 Pauan: and I tried passing only #\p to read/recursive 15:06 Pauan: but that didn't work 15:06 Pauan: it needs to be both #\# and #\p 15:06 Pauan: (sadly, read/recursive only supports one-character prepending) 15:07 (quit) anRch: Quit: anRch 15:07 (join) si14 15:16 RackN00b: ahhh! I'm having a serious mental issue at present - can anyone enlighten me as to why this is not valid? http://pastebin.com/1jybiVez 15:17 Pauan: missing paren 15:17 RackN00b: yeah just found it... check all but the first! thanks 15:17 Pauan: actually, placed incorrectly 15:17 Pauan: remove one paren from the end of pieceheight too 15:19 RackN00b: yeah that's what I did... 15:22 Pauan: well, I better head out now, bye 15:22 RackN00b: seeya! Thanks again Pauan... for everything you've helped me with 15:23 RackN00b: I owe you many a beer 15:29 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/H3ll-A 15:29 RacketCommitBot: [racket/master] use an aug-keymap instead of a keymap for the scheme mode keymap container - Robby Findler 16:02 (join) MayDaniel 16:07 (quit) realitygrill: Quit: realitygrill 16:14 (join) tyson1 16:18 (quit) MayDaniel: 16:22 (join) realitygrill 16:36 RackN00b: Hey guys - any chance of getting a hand recursing through three difference lists at the same time? I am completely lost - I can't figure out where to being... Here's what I have thus far...http://pastebin.com/KQyKMDFG I am trying to create a structre I've defined as (define-struct state (puzzle pieces)) where the pieces are a list of polyominoes. I need to create a list of all possible states given the consumed s 16:36 RackN00b: by checking to see if each polyomino in the list, as well as all of its orientations, under each of a list of offsets, can fit into an empty spot on the puzzle. If so, I create the structure with the superposition and the remaining polyominoes in the second part. So I have to recurse on the list of polyominos. Each polyomino has a list of orientations. Each orientation has a list of offsets. Now my predicate for 16:36 RackN00b: testing if a given offset/polyomino combo is valid works... I just can't seem to put it all together... 16:37 freakazoid: is it possible to pull a value out of a closure? I.e. can closures be used to implement capability-based security without needing to restrict reflection that would be available in a sandbox using #lang racket/base? 16:37 freakazoid: I guess that's not an i.e. 16:50 (join) keenbug 16:51 (quit) realitygrill: Ping timeout: 245 seconds 17:04 samth: freakazoid: no, closures are closed :) 17:04 freakazoid: oh phew 17:05 freakazoid: they're not in, for example, python 17:05 freakazoid: where you can use reflection to get at values inside them 17:05 freakazoid: or rather introspection 17:33 (join) MayDaniel 17:45 (quit) karswell: Read error: Connection reset by peer 17:47 (join) karswell 17:49 freakazoid: when syncing on multiple channels, how does one tell which channel the message came from? 17:52 jonrafkind: well thats a good question, it doesn't look like theres a way. but why do you need it? 17:53 (quit) DanBurton: Quit: ChatZilla 0.9.87 [Firefox 6.0/20110811165603] 17:56 RackN00b: Pauan - you still around by any chance? 17:58 freakazoid: how do I use the contents of a variable in a match pattern? 17:58 freakazoid: 'variable seems not to work 17:59 (quit) jeapostrophe: Ping timeout: 244 seconds 18:00 samth: freakazoid: use the `==' pattern 18:00 freakazoid: oh, thanks 18:00 samth: or, manually, (? (lambda (v) (equal? v variable)) 18:00 freakazoid: that's not mentioned in the reference 18:00 samth: it's currently (in 5.2) in the `unstable/match' library 18:00 samth: in the next release, it will be in `racket/match' 18:01 samth: rudybot: (require unstable/match) 18:01 rudybot: samth: your racket/init sandbox is ready 18:01 rudybot: samth: Done. 18:01 samth: rudybot: doc == 18:01 rudybot: samth: http://docs.racket-lang.org/unstable/match.html#(form._((lib._unstable%2Fmatch..rkt)._~3d~3d)) 18:01 samth: freakazoid: there 18:01 freakazoid: ah, thanks 18:02 freakazoid: jonrafkind: I have multiple threads talking to a single multiplexor 18:02 freakazoid: jonrafkind: I could use tagged messages and share an upstream channel though 18:03 freakazoid: it just seems like sync discards information in that case, though 18:03 samth: `sync' doesn't tell you what event produced the message 18:03 samth: you could wrap it with `wrap-evt' 18:03 samth: rudybot: doc wrap-evt 18:03 freakazoid: aah! 18:03 rudybot: samth: http://docs.racket-lang.org/reference/sync.html#(def._((quote._~23~25kernel)._wrap-evt)) 18:03 freakazoid: I forgot about that one 18:04 freakazoid: sharing channels may, in fact, be better 18:04 samth: that would let you add a tag 18:04 samth: for example: 18:04 freakazoid: actually come to think of it, I guess that was more of a theoretical question 18:04 freakazoid: since now that I think of it I am using only one channel per listener 18:05 freakazoid: the same as erlang inboxes 18:05 freakazoid: err, mailboxes 18:05 samth: (define (sync/tagged . args) (apply sync (for/list ([e args]) (wrap-evt e (lambda (v) (cons e v)))))) 18:05 samth: that cheats and uses the event as the tag 18:21 (quit) keenbug: Ping timeout: 260 seconds 18:32 (quit) MayDaniel: Read error: Connection reset by peer 18:46 (quit) tyson1: Quit: Leaving. 18:47 (part) masm 18:52 (quit) fridim_: Ping timeout: 252 seconds 18:53 freakazoid: hmm, how is #:requires supposed to work in (make-evaluator if the sandbox can't properly resolve the path to modules? 18:54 freakazoid: I try to add #:requires '(racket/async-channel) and I get: http://www.fburl.com/?key=2205022 18:54 freakazoid: err 18:54 freakazoid: resolve-path: `exists' access denied for / 18:55 (join) masm 18:57 (join) jeapostrophe 18:57 samth: eli might know the answer 18:57 samth: but i think that's just to be expected if you try to access the file system 18:57 freakazoid: do you know if there's a way to pre-resolve the path? 18:58 samth: that wouldn't help -- it can't read the file system 18:58 freakazoid: it adds the modules in #:requires to #:allows 18:58 freakazoid: so it should be able to read the modules themselves 18:58 samth: oh hm 18:58 samth: then i'm not sure 18:58 freakazoid: (according to the docs at least) 18:59 samth: you could look at how rudybot works 18:59 samth: rudybot: source 18:59 rudybot: samth: git clone git://github.com/offby1/rudybot.git 18:59 samth: rudybot: web page 18:59 rudybot: samth: i know i can just use a web browser, but is there a way to do it in emacs as well? 18:59 freakazoid: thnks 19:00 freakazoid: samth: doesn't use any modules in the sandbox :( 19:03 samth: freakazoid: this use #:requires https://github.com/plt/racket/blob/master/collects/handin-server/utils.rkt 19:04 freakazoid: thanks 19:05 freakazoid: samth: hmm, nothing actually shows what's passed for #:requires - it's all passed through from the exported functions 19:05 samth: you probably have to look around through the rest of that library then 19:06 freakazoid: oh I wonder if I have to do stuff with the paths 19:10 (quit) jeapostrophe: Ping timeout: 244 seconds 19:17 freakazoid: samth: Ah, I realized I didn't actually need the module after all - I just defined the functions that needed the module outside the sandbox and passed them in using quasiquote and unquote 19:18 freakazoid: I guess I could just unquote references to stuff in the module too 19:19 (quit) dingfeng: Ping timeout: 265 seconds 19:22 (join) realitygrill 19:25 (join) francisl 19:44 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/ywE2Sg 19:44 RacketCommitBot: [racket/master] add in keymap mixin - Robby Findler 19:45 (quit) Blkt: Quit: good night... 20:00 (quit) espringe: Quit: Leaving. 20:01 RackN00b: Guys - can anyone help me ? I am having a killer time finding out why my solver doesn't end... Can I post the code to pastbin? I am managing to only look at the first polyomino from the set of them... 20:32 (quit) jonrafkind: Ping timeout: 255 seconds 20:41 (join) jeapostrophe 20:47 (quit) RackN00b: Quit: RackN00b 20:47 (nick) samth -> samth_away 21:12 (join) dnolen 21:26 (part) masm 21:39 (quit) mithos28: Quit: mithos28 21:39 (quit) dnolen: Read error: Connection reset by peer 21:40 (join) dnolen 21:52 freakazoid: is match with only two cases, one of which is an == and the other of which is just a default, likely to be slower than a let and an if? 21:52 freakazoid: or will that end up compiling to basically the same code? 21:53 (quit) Shviller: Ping timeout: 255 seconds 21:53 (join) Shviller 22:04 (quit) francisl: Quit: francisl 22:19 (quit) jeapostrophe: Ping timeout: 252 seconds 22:41 (join) jeapostrophe 22:53 (join) mithos28 23:08 (quit) jeapostrophe: Ping timeout: 260 seconds 23:15 (join) jonrafkind