00:20 (join) Phil 00:22 Phil: Hi - I have a question on how to write an integer division function in scheme. Can anyone look at my function and help me out? 00:22 jonrafkind: sure 00:22 jonrafkind: you know one exists though, right? 00:22 Phil: Yeah 00:23 Phil: It's a homework assignment and I just have a question about it. 00:23 Phil: http://www.heypasteit.com/clip/PFT 00:23 jonrafkind: ok 00:23 Phil: We are supposed to return a list with the remainder in it 00:23 Phil: (quotient_of_x/y remainder_of_x/y) 00:23 Phil: And I don't understand how to increment the quotient as I go down while keeping the remainder as I recurse up 00:23 Phil: Does that make sense? 00:24 jonrafkind: hm 00:25 Phil: Right now, its just returning the remainder 00:25 Phil: obviously 00:25 Phil: I've also got it to return only the quotient 00:25 Phil: But I can't get it to do both.... 00:25 jonrafkind: you could use a third argument for the quotient 00:26 jonrafkind: right now you just have x and y 00:26 Phil: We aren't allowed to for the assignment. Otherwise that would work... 00:27 Phil: Here are the specs... 00:27 Phil: http://www.heypasteit.com/clip/PFU 00:28 askhader: ` 00:29 jonrafkind: ' 00:30 Phil: So its stumped you too jonrafkind? 00:31 askhader: (define (div) (lambda (x y) `((/ x y) (modulo x y)))) 00:31 askhader: I think that, or something like that should do the trick. 00:31 Phil: I have to use the minus function otherwise I'd just use / and remainder 00:31 askhader: Oh\ 00:31 askhader: Of course 00:32 Phil: Its cool though. Thanks for giving it a look! 00:32 askhader: What language level do you have? 00:32 askhader: I can whip it up for you if you like. 00:32 Phil: Whip what up for me? 00:32 askhader: I really shouldn't since it's an assignment, but I'll take any opportunity to write a scheme function. 00:32 askhader: div according to the specification.. 00:32 Phil: It's Advanced Student 00:33 askhader: Okay, momento 00:33 Phil: I'd be immensely greatful - I've done the rest of the assignment GCD, trees, etc. 00:33 askhader: CS studnet? 00:33 askhader: student, even 00:34 askhader: hush now 00:34 askhader fires up drracket 00:36 Phil: Yup. It's Discrete Structures. The whole class seems to be focused on Sets, Grammars, and data structures like that. But none of it actually describes implementation. It's all very theoretical and it makes it a real challenge when the programming assignments come up. 00:37 askhader: (div x y) is x >= y ? 00:37 askhader: Phil: ^ 00:37 Phil: yes 00:37 askhader: Goodie gumdrops. 00:37 Phil: Let me send the specs 00:38 Phil: http://www.heypasteit.com/clip/PFV 00:41 Phil: The other solution would be to recurse twice which works... But it crashed when I started using bigger numbers. 00:41 Phil: Plus its obviously ineffecient 00:49 askhader: Phil: ping 00:49 Phil: What's up? 00:50 askhader: (define div 00:50 askhader: (lambda (x y) 00:50 askhader: (letrec ((recDiv (lambda (a b count) 00:50 askhader: (cond ((< a b) (list count a)) 00:50 askhader: ((= a b) (list (add1 count) 0)) 00:50 askhader: (true (recDiv (- a b) b (add1 count))))))) 00:50 askhader: (recDiv x y 0)))) 00:50 askhader: gah 00:50 askhader: Terribly sorry! 00:51 askhader: http://paste.lisp.org/display/116755 00:51 askhader: Stupid cygwin 00:51 Phil: Thanks a lot! 00:51 askhader: My pleasure 00:51 askhader: Do you understand how it works? 00:52 Phil: Kinda... You've got two functions. 00:52 Phil: One that recieves the x and y 00:52 Phil: That calls the second function which takes x y and count 00:52 askhader: You are familiar with lambda? 00:53 Phil: Just in the sense that I'm supposed to put it in all my functions. What is its actual purpose? 00:53 askhader: Let me demonstrate it in code 00:53 askhader: One moment. 00:53 Phil: I'll pull up the docs too haha 00:54 askhader: lambda is an anonymous function for which you can define an arbitrary number of paramaters. 00:55 askhader: (define (addOne x) (+ x 1)) (define addOne (lambda (x) (+ x 1)) 00:55 askhader: lambda becomes convenient when you want to define a function that exists purely within the scope of another function. As in recDiv 00:58 Phil: I'm reading up on it now! Thanks a lot! 00:58 askhader: My pleasure. Happy racketeering and scheming! 00:58 Phil: Racketeering :). I forgot about that. 00:58 (quit) Phil: Quit: Page closed 01:56 (quit) hanDerPeder: Quit: hanDerPeder 02:16 (quit) writer: Quit: writer 02:33 (quit) jonrafkind: Ping timeout: 240 seconds 03:04 (join) hanDerPeder 03:11 (quit) hanDerPeder: Ping timeout: 240 seconds 03:14 (join) hanDerPeder 03:19 (quit) racklet: *.net *.split 03:36 (join) racklet 05:22 (join) jeapostrophe_ 05:29 (quit) Axsuul: Read error: Connection reset by peer 05:40 (join) fjl 06:02 (join) jao 07:35 (join) mceier 08:00 (join) b-man_ 08:21 (join) MayDaniel 08:38 (quit) MayDaniel: 08:45 (quit) jeapostrophe_: Quit: jeapostrophe_ 08:50 (join) anRch 09:00 (join) jeapostrophe_ 09:20 (quit) jeapostrophe_: Quit: jeapostrophe_ 09:21 (quit) mceier: Quit: leaving 09:29 (join) jeapostrophe_ 09:34 (quit) jeapostrophe_: Quit: jeapostrophe_ 10:14 (join) jeapostrophe_ 10:14 (quit) jeapostrophe_: Client Quit 10:20 (join) MayDaniel 10:27 (join) writer 10:32 (quit) hanDerPeder: Quit: hanDerPeder 10:49 (quit) anRch: Quit: anRch 11:06 (quit) MayDaniel: 11:12 (join) sstrickl 11:51 (join) MayDaniel 12:10 (join) anRch 12:13 (quit) MayDaniel: 12:20 (quit) jao: Ping timeout: 272 seconds 12:36 (join) jonrafkind 12:44 (quit) tv|z: Ping timeout: 255 seconds 12:46 (join) tv|z 12:50 (quit) anRch: Quit: anRch 13:15 (join) mceier 13:37 (join) MayDaniel 13:46 (quit) MayDaniel: 13:54 (join) thewolf 13:54 thewolf: hi 13:55 thewolf: how can i combine 2 lists and save them in another? 13:55 thewolf: (append list1 list2) only does it "temporarily" 13:55 thewolf: i want something like list1 = (append list1 list2) 13:56 (join) carleastlund 14:14 (join) jao 14:17 (quit) thewolf: Quit: Page closed 14:24 (quit) vu3rdd: Quit: ERC Version 5.3 (IRC client for Emacs) 14:32 (join) Kirill 14:32 Kirill: hi! does Racket support parallel execution of map & co? 14:32 Kirill: is there some special version of map, filter, and so on, that would run the computation in parallel? 14:39 jonrafkind: you could probably use futures with map 14:39 jonrafkind: i dont know how expensive it is to create a future though 14:39 carleastlund: Kirill, Racket's support for parallelism is currently experimental, and not built in to any of our primitives yet. 14:39 jonrafkind: and it would only be parallel if you happen not to call back into the racket vm 14:40 carleastlund: We have two mechanisms: "futures" and "places"; for the fine-grained parallelism you're talking about, you'd want futures. And like jonrafkind says, they may not get you what you're looking for, as they don't behave quite like parallelism in other langauges. 14:50 Kirill: I guess I could write it myself using a thread pool or something.. 14:50 Kirill: does racket have thread pools? =) 14:52 (join) hanDerPeder 14:53 (quit) hanDerPeder: Client Quit 14:56 jonrafkind: it has green threads, places are native threads 14:56 jonrafkind: try using futures, if it doenst work then you can try something else 14:56 Kirill: sure 14:56 Kirill: So I'll have to write my own "map" function that will use future/touch? 14:58 jonrafkind: yea 14:59 clklein: Kirill: Be sure to read this section of the docs: http://docs.racket-lang.org/guide/performance.html?q=futures#%28part._effective-futures%29 14:59 rudybot: http://tinyurl.com/23fczbw 14:59 Kirill: reading it now =) 15:00 Kirill: so for example, if each operation requires spawning a subprocess, then it's "not safe for parallelism"? 15:01 jonrafkind: yea 15:01 jonrafkind: you can use communicating processes through pipes, if you don;t have to share any data 15:02 Kirill: Yeah there's no data sharing between the subprocesses 15:02 Kirill: so spawning a subprocess in a thunk that's given to "future" is a bad idea, correct? 15:02 Kirill: I think the best approach in this case is to use "thread" and manage a thread pool somehow 15:03 jonrafkind: yea but they will only execute on one processor 15:03 (join) offby1` 15:03 jonrafkind: so you will get concurrency but not parallelism 15:03 jonrafkind: futures potentially give you parallelism 15:03 Kirill: jonrafkind: why? racket threads are "green threads"? 15:03 jonrafkind: meaning they execute in one process 15:04 Kirill: hold on. does racket use native threads? 15:04 jonrafkind: for futures it does 15:04 jonrafkind: green threads are fake threads basically 15:04 jonrafkind: the vm will schedule and manage green threads itself 15:04 (quit) offby1: Read error: Connection reset by peer 15:06 jonrafkind: and places are native threads too 15:08 Kirill: how can I find out what's "safe" parallelism and what isn't? can I spawn a subprocess from a future? 15:11 jonrafkind: well thats a good question, and looking through the docs i dont see a list of operations that are unsafe 15:11 jonrafkind: would you like to send an email to the list requesting a specific list? 15:11 jonrafkind: if not i can do so on your behalf 15:14 Kirill: please, if it's not too much trouble =) 15:15 jonrafkind: ok 15:16 (quit) writer: Quit: writer 15:19 (join) writer 15:20 Kirill: thanks 15:21 Kirill: where can I track the mailing list thread? 15:22 samth: Kirill, the mailing lists are listed here: http://racket-lang.org/community.html 15:22 jonrafkind: http://www.mail-archive.com/users@racket-lang.org/ 15:22 jonrafkind: it should show up here very soon 15:22 Kirill: great, bookmarked 15:22 clklein: Kirill: I think you're expected to try (future (lambda () potentially-unsafe-thing)) and run "racket -W" to see the debug info 15:23 clklein: If it's not safe, the debug info will say "future blocked on ..." 15:23 samth: clklein, that's not really a great story, though 15:23 jonrafkind: yea it should be listed in the docs 15:23 clklein: samth: I never claimed it is. 15:23 samth: right 15:24 jonrafkind: tangentially related.. i still hate mailing lists and wish we would move or at least add a forum option too 15:24 jonrafkind: i think someone tried that at one point but it failed for some reason..? 15:24 samth: jonrafkind, get off my lawn! 15:25 clklein: jonrafkind: because they're not convenient for casual users? 15:25 samth: or for heavy users 15:25 clklein: How would a forum be more convenient for heavy users? 15:25 jonrafkind: maling lists? yea there are multiple problems. 1. causal users 2. i have to skip a lot of crap 3. correlated with 2, i am prevented from sending "silly" messages because it would bother other users 15:25 carleastlund: Yeah, I'm not a fan of forums in general. 15:26 clklein: I'd just end up using whatever RSS, email notification, etc. the forum provided to find out about new discussions 15:26 jonrafkind: once I tried subscribing to the linux mailing lists just to see what was going on, but having received something like 400 emails per day I quickly got off 15:26 carleastlund: jonrafkind, if forum usage would prompt you or others to start spamming racket or racket-dev with "silly" messages, then I'm all for mailing lists. Work mail does not need to be intermingled with joke time, no matter the method of transmission 15:27 jonrafkind: im not saying i would post lolcat pictures, but there are some less serious emails that don't get sent because they have a slightly higher noise to signal ratio than other emails 15:27 jonrafkind: maybe its for the best, but sometimes i find it annoying 15:27 carleastlund: You're complaining about the volume of messages already, but then paradoxically you want to increase it in another medium. 15:28 jonrafkind: another medium where you can ignore the volume 15:28 carleastlund: I guess I don't understand what you're hoping for in a forum. 15:28 carleastlund: Ignoring the volume means ignoring messages. 15:28 jonrafkind: yes but in my email client i have to do some action to ignore messages (yes get a better email client.. not gonna happen) 15:28 jonrafkind: forums streamline the process of ignoring stuff you dont care about 15:29 carleastlund: jonrafkind, if you're not willing to get a new client but you're asking us to entirely switch technologies... pot, kettle, black 15:29 samth: see earlier discussion of your trespass on the property adjacent to my house 15:29 jonrafkind: there are no email clients that work allow the same functionality as forum software, afaik 15:30 samth: jonrafkind, i recommend gmane and a news reader 15:30 clklein: The mailing list needs a "don't send me p% of the traffic" option 15:30 carleastlund: What forum functionality do you want? 15:30 carleastlund: Every time I've used a forum, I wished it wasn't missing features I could use in my email reader. But perhaps you have used better forums. 15:31 jonrafkind: i like being able to selectively read threads when I feel like instead of messages being pushed to me 15:32 carleastlund: That works for casual things, but racket and racket-dev are places where we PLT folks provide technical assistance with our research products. Our users don't want us putting off their threads until we feel like it. 15:32 samth: also, racket-dev is a place for the developers to get work done, not just a forum for random people to blather 15:33 jonrafkind: yes because thats what i was saying the entire time. great job 15:33 samth: so which traffic should go into this forum? 15:59 (part) Kirill: "ERC Version 5.3 (IRC client for Emacs)" 16:03 clklein: tewk: ping 16:04 clklein: Is this record ever enough to track down a crash? 16:05 clklein: http://pastebin.com/35EWrTVy 16:06 clklein: Unfortunately, I have no more information at all. I eval'd a random program involving delimited continuations, continuation marks, and dynamic-wind. 16:09 (join) lisppaste 16:36 eli: jonrafkind: gmail has an option to "mute" a thread, which makes it silently archive it as it comes in, unless someone directs a message to you. Sounds close to what you're describing. 16:36 jonrafkind: yea, i wish i had something like that 16:36 eli: Otherwise, i don't see the big conceptual difference between scanning subject lines in your mailbox from and scanning them on a forum page. 16:36 eli: Gmail is free, you know? 16:37 jonrafkind: ive been debating moving to gmail for a while now, but basically its impractical for me 16:37 eli: Two more options: 16:37 jonrafkind: well not entirely impractical, just inconvenient 16:37 eli: You can just use gmail for the plt lists, 16:37 eli: or you can use it via gmane, which will give you a newsgroup interface. 16:37 eli: (Where newsgroup readers are very tuned to being able to ignore threads.) 16:38 jonrafkind: ill keep it in mind 16:38 eli: You're using FF right? 16:39 jonrafkind: chrome 16:39 jonrafkind: i use thunderbird for email 16:39 eli: OK, and thunderbird does newsgroups too, right? 16:40 eli: If so, just point it at nntp://news.gmane.org/gmane.comp.lang.racket.user 16:40 eli: And if/when that works, you can flip a mailman switch to avoid mail delivery to your mailbox, so you can still post, but you don't get the emails pushed to you. 16:47 jonrafkind: hm, seems like thunderbird forces me to click on newsgroup posts to read them, just like normal email 16:49 eli: And forums are somehow clickless? 16:49 jonrafkind: yes, you dont need to click on a topic if you dont want 16:49 jonrafkind: each time a new message appears 16:49 eli: I'm not getting it. 16:50 jonrafkind: i mean, if a message appears in the newsgroup and I hit 'n' to goto the next message thunderbird will direct me to the newsgroup message 16:50 eli: If you don't want to read a topic in a forum, you say that you don't click on it. 16:50 jonrafkind: i can't skip over the message 16:50 eli: What's the difference from the newsreader? 16:50 jonrafkind: what i just said 16:50 jonrafkind: i mean ok, essentially nothing, but the fact that I use 'n' to move between messages is the only difference 16:51 jonrafkind: but moving between messages without using 'n' would make life impossible 16:51 eli: So, things boil down to your use of some specific key in thunderbird? 16:51 jonrafkind: its the only possible way to navigate email 16:51 eli: That doesn't sound like a good reason to switch everyone to a completely different medium. 16:52 eli: My laptop's keyboard has problems with `x'. 16:52 eli: I need to use `x' to read my mail in Emacs. 16:52 eli: Conclusion: I'll suggest disassembling the list and move to phone calls. 16:52 jonrafkind: good job 16:52 jonrafkind: if thats your logic im not gonna even try 16:53 eli: You *did* say that it's due to whatever thunderbird is doing with `n'. 16:53 eli: Another interface you can try is http://blog.gmane.org/gmane.comp.lang.racket.user 16:53 jonrafkind: yes but its about navigating email, not about the 'n' key itself (i dont know if thats what you're trying to imply) 16:54 eli: Or: http://news.gmane.org/gmane.comp.lang.racket.user 16:54 eli: Or one of the four RSS feeds it gives you, with some RSS reader. 16:54 eli: I don't see any conceptual difference between navigating email and navigating a forum. 16:55 eli: It sounds like whatever your complaint is, it's between you and your mailer. 16:55 eli: You can switch that. 16:55 jonrafkind: there are no reasonable alternatives 16:55 eli: Or with the NNTP interface you can use a newsreader. 16:55 jonrafkind: ive been through basically all of them and thunderbird is the best 16:55 eli: Or with the RSS feed you can use an RSS reader. 16:56 eli: Clearly, thunerbird is not the best if it fails on some feature that is so important for you. 16:56 jonrafkind: thats true, but it wins on every other feature thats important 16:56 eli: Make up your own reader then. 16:57 jonrafkind: yea.. ill just write my own os first.. see you in 40 years 16:57 eli: Having all of these alternative forms of the mailing list should make it easy. 16:57 eli: Whatever it is, it's far from being a good reason to switch *everyone*. 17:14 (quit) b-man_: Remote host closed the connection 17:41 (join) anRch 18:33 (quit) anRch: Quit: anRch 19:15 (join) jeapostrophe_ 19:16 (quit) jeapostrophe_: Client Quit 19:25 (join) b-man_ 19:44 (quit) mceier: Quit: leaving 20:00 (quit) sstrickl: Quit: sstrickl 20:15 (join) snowman 20:16 (quit) snowman: Client Quit 20:17 (join) seeingstars115 20:17 seeingstars115: Can anyone help me on a homework question 20:17 seeingstars115: ?? 20:20 (join) kksun 20:20 seeingstars115: Can someone help me on a homework question?? 20:21 (part) seeingstars115 20:23 (join) seeingstars115 20:24 seeingstars115: HELLO?!?!?!? 20:24 (join) snowman 20:25 (part) seeingstars115 20:27 (quit) snowman: Client Quit 20:28 (join) seeingstars115 20:28 jonrafkind: seeingstars115, try sitting in the channel for more than 2 seconds 20:28 seeingstars115: ok sorry 20:29 seeingstars115: So my question is: In a small school, the students are divided into homerooms by last name. Students with last names that begin with A-E are in homeroom 1, F-L are in homeroom 2, M-R are in homeroom 3, and S-Z are in homeroom 4. Write the function find-homeroom-number. It takes in a student's last name (as a string) and gives back the student's correct homeroom number. 20:33 (quit) jonrafkind: Ping timeout: 265 seconds 20:58 (join) jeapostrophe_ 21:01 (quit) kksun: Quit: Page closed 21:03 carleastlund: seeingstars115, what is your question about that assignment? 21:06 seeingstars115: It's fine I just figured it out. But thanks anyway 21:09 (quit) seeingstars115: Quit: Page closed 21:32 (join) maelstorm 21:33 (quit) carleastlund: Quit: carleastlund 21:34 maelstorm: is this room for assistance with racket? 21:37 (quit) maelstorm: 21:49 (quit) jeapostrophe_: Quit: jeapostrophe_ 21:52 Quetzalcoatl_: Yes. That's one of the purposes of this room. 21:58 (quit) b-man_: Read error: Connection reset by peer 22:24 (nick) offby1` -> offby1 22:24 (quit) offby1: Changing host 22:24 (join) offby1