00:08 (join) offby1 00:13 (join) masm 00:13 (quit) masm: Client Quit 00:25 (quit) carleastlund: Quit: carleastlund 00:37 (join) coldhead 00:38 coldhead: sup ChanServ 00:40 offby1: dine rudybot 00:57 (join) jonrafkind 01:57 (quit) parcs: Ping timeout: 240 seconds 01:59 (join) parcs 02:07 (join) CoolgyFurlough 02:42 (join) mceier 03:01 (quit) CoolgyFurlough: Ping timeout: 260 seconds 03:38 (quit) Lajla: Ping timeout: 276 seconds 04:06 (quit) jonrafkind: Ping timeout: 276 seconds 04:53 (join) stis 06:45 (quit) coldhead: Quit: bababadalgharaghtakamminarronnkonnbronntonnerronntuonnthunntrovarrhounawnskawntoohoohoordenenthurnuk 07:38 bremner: no, dein rudybot 07:41 (nick) abbe -> all 07:41 (nick) all -> abbe 07:51 (quit) jao: Read error: Operation timed out 08:01 (join) carleastlund 08:57 (join) MayDaniel 09:56 (join) lucian 10:18 (quit) corruptmemory: Ping timeout: 240 seconds 10:19 (join) corruptmemory 10:21 (join) sam_ 10:23 sam_: Hi at all. How look s a definition with 2 arguments. 1 argument must be a list and second one must be a integer ? 10:23 sam_: (define (f '(b a) y) dont work 10:24 carleastlund: Are you trying to define the function or call it, sam_? 10:24 sam_: define 10:24 sam_: name of funtion is f 10:24 carleastlund: Then you just need to give the list a name. You don't need to quote it and give it elements b and a. 10:25 sam_: you mean like that (define (f '(list) y) ? 10:25 carleastlund: (define (f a-list an-integer) body-of-the-function-goes-here) 10:27 (quit) corruptmemory: Ping timeout: 255 seconds 10:27 sam_: ok thx i think it worls now 10:27 carleastlund: Glad to help, sam_. :) 10:29 sam_: Ok :D Next question. My list have 3 integer elements. for example 1 2 and 3 in body of this fuction i want multiply each integer of this list with second argument of this fuction. how i can do this 10:29 (join) corruptmemory 10:30 sam_: Example '(1 2 3) 2 --> 2 4 6 10:32 carleastlund: sam_, is this a homework assignment? I can think of several ways to solve that problem, but most of them would fail as a homework solution. If you need to do it for a class, you probably need to follow whatever method is taught in your textbook. If not, I'd use: (for/list ([x (in-list a-list)]) (* x an-integer)) 10:35 sam_: No, i have here 250 math. problems. I solved all with Java. Now i try it with new language. 10:35 sam_: good way to learn racket 10:35 carleastlund: Ah, okay. Well then, give my for/list solution a try. :) 10:38 sam_: Your solution looks little complicated for me :D Is there no way to get an element from a list and use it ? 10:39 sam_: My pseudo code looks like. get frist elemt from a list and multiply with n, get second elemtnd and multiply with n , get third element and multiply with n... 10:40 carleastlund: That's going to be the laborious way to do things, if you have to multiply each individual element in order, rather than just do one multiplication. As a starting point, though, you can use the functions "first" and "rest" to break down a list. So the first element of a-list is (first a-list), the second is (first (rest a-list)), and so on. 10:41 carleastlund: Er, I mean write one multiplication, not do one. Obviously the program has to do three multiplications to cover the whole list. But you can just tell it how once with my solution. 10:42 (quit) MayDaniel: Read error: Connection reset by peer 10:43 carleastlund: If you're looking for a good way to learn Racket programming, I would point you at "How to Design Programs", available online at www.htdp.org -- it teaches Racket programming from the ground up, and as you go through it you can look back at your math problems to see which ones you've learned how to solve so far. 10:49 sam_: How i can delete first element of a list ? 10:50 sam_: cdr? 10:52 carleastlund: You don't delete list elements in Racket -- you just extract a new list that doesn't contain that element. The old list is still hanging around, if you have a reference to it. But yes, either "cdr" or "rest" will produce a new list by dropping the first element of the input. 10:58 (quit) corruptmemory: Ping timeout: 255 seconds 11:01 sam_: Can you tell me why this is here rnicht? Or correct it http://codepad.org/5D6CGKzY 11:01 sam_: Can you tell me why this dont work 11:02 carleastlund: Your function has two bodies; it doesn't combine the part using the car of the list with the part using the cdr. Also, it always calls itself again on the cdr, so it is guaranteed to loop forever or until it raises an exception. 11:02 (join) anRch 11:04 carleastlund: I would definitely suggest www.htdp.org -- the early chapters go fast, and by the end of chapter 9 writing this kind of function is second nature. Going through the exercises will be more instructive than anything I can tell you over IRC. 11:04 (join) corruptmemory 11:12 sam_: Well, I'm starting tomorrow to read this book. But can you tell me now with an example code how I do it now? (f '(1 2 3) 3) ->' (3 12 6) Is good for motivation if I did not leave unresolved 11:12 sam_: :D 11:18 (quit) corruptmemory: Ping timeout: 255 seconds 11:27 (quit) martinhex: Read error: Connection reset by peer 11:28 (join) corruptmemory 11:42 (quit) anRch: Quit: anRch 11:43 (join) martinhex 11:49 (quit) sam_: Quit: Page closed 11:49 (quit) lucian: Read error: Connection reset by peer 11:50 (join) lucian 11:58 (join) Lajla 12:10 (join) jao 12:50 (join) anRch 12:52 (join) mheld 13:12 (quit) anRch: Quit: anRch 13:30 (join) MayDaniel 13:41 (quit) corruptmemory: Ping timeout: 255 seconds 13:46 (join) corruptmemory 14:03 (join) masm 14:03 (quit) MayDaniel: Read error: Connection reset by peer 14:25 (join) carleastlund_ 14:27 (quit) carleastlund: Ping timeout: 240 seconds 14:27 (nick) carleastlund_ -> carleastlund 14:28 (join) dnolen 14:35 (join) jonrafkind 14:54 (quit) Lajla: Ping timeout: 240 seconds 15:00 (quit) Demosthenes: Quit: Lost terminal 16:00 (nick) abbe -> everyone 16:00 (nick) everyone -> abbe 16:20 (quit) parcs: Ping timeout: 240 seconds 16:21 (join) parcs 17:02 (quit) tv|z: Ping timeout: 240 seconds 17:04 (join) tv|z 17:18 (join) coldhead 17:35 (quit) stis: Remote host closed the connection 17:47 em: hey is there a racket package in the latest ubuntu yet? 17:52 em: bremner, I don't see any package for Racket even in Natty! 17:56 (join) swsch 17:56 swsch: hi, I need some help to be able to sleep later on 17:57 swsch: I am stuck on creating a stateless servlet in racket 17:58 swsch: this works: (define hello-servlet (make-v2.servlet (current-directory) (default-lru-manager) hello-servlet-start)) 17:59 swsch: this does not: (define world-servlet (make-stateless.servlet (current-directory) default-stuffer (create-none-manager #f) world-servlet-start)) 18:00 swsch: racket complains about a violation of the manager contract 18:01 swsch: racket even complains about a violation when I'm using the same (default-lru-manager) that I have working for stateful servlets 18:02 swsch: what is the obvious thing that I'm missing? 18:10 (join) mwolfe 18:16 (join) anRch 18:43 (quit) anRch: Quit: anRch 18:50 (quit) dnolen: Quit: dnolen 19:19 (join) Lajla 19:35 bremner: em: I don't know about ubuntu. I just work on the debian packages, but those are not in the archive yet either because of the squeeze release. 19:35 bremner: em: do you want to try recompiling the debian source packages on Ubuntu? 19:46 offby1: "Natty", eh? 19:46 offby1: Natty Nougat 19:46 offby1: Natty Dread 19:46 offby1: All my enemies 19:46 offby1: Think I'm dead 19:46 offby1: Burma Shave 20:05 (quit) mwolfe: Remote host closed the connection 20:06 em: bremner: yeah ubuntu syncs with packages that get into Debian. 20:06 bremner: mostly that is true. 20:17 (join) mwolfe 20:26 (part) jao: "Killed buffer" 20:30 (quit) mceier: Quit: leaving 21:14 (quit) lucian: Remote host closed the connection 21:30 Lajla: Is there a particular reason by the way why case does not evuate its cases, I remember once figuring out what the reaosn was but I forgot. 21:33 carleastlund: So the compiler knows what it's dispatching on. It can be compiled more efficiently that way. 21:36 Lajla: I remember there to be some obvious thing with macro expansion though. 21:37 Lajla: That made the cheapest macro unable to perform an evaluation, but not sure. 21:37 carleastlund: Unable to perform an evaluation? Macros don't perform evaluation in any event. 21:37 Lajla: thatÅ› not what I mean. 21:38 carleastlund: Yeah, I probably don't get what you mean. So... what do you mean? 21:38 Lajla: And macros can perform evaluation if done explicitly. But what I mean is basically that there was some really neet standard macro for case wich conflicted with the cases evaluating. 21:38 Lajla: But I forgot what it was. 21:41 carleastlund: I'm having a hard time thinking of a macro that quotes the case values that couldn't be switched in just a few keystrokes to evaluating them... it's the difference between '(x ...) and (list x ...). 21:47 Lajla: Yeah, that's why I'm confused. 21:47 Lajla: I'm sure I once knew it. 21:49 carleastlund: There is a question of evaluation order, though. If they were evaluated, should they all be evaluated to begin with, or should each one only be evaluated as necessary? In other words, do you skip the rest after hitting a match? Quoting makes writing the macro easier because you don't have to worry about that. 21:52 Lajla: Yeah, that's also a thing I guess. 21:52 Lajla: But I'm sure the standard could define that either they have to be evaluated for the check or that they may all be evaluated in unspecified order. 21:55 carleastlund: Everything with "unspecified order" in Scheme still gets evaluated, though. Leaving it open to interpretation whether something gets evaluated at all is a much bigger semantic change. 21:58 (quit) masm: Quit: Leaving. 21:59 Lajla: It wouldn't leave that open though. 21:59 Lajla: If the cases would get evaluated before the test they would. 22:00 (join) poindontcare 22:00 Lajla: I know there was a huuge reason why they weren' though, and I'm trying to find what it was. 22:50 (quit) poindontcare: Ping timeout: 272 seconds 23:24 (quit) corruptmemory: Ping timeout: 240 seconds 23:28 (join) corruptmemory 23:35 (quit) corruptmemory: Read error: Operation timed out 23:42 (join) lewis1711 23:42 lewis1711: hello, I would like the problem this guy has http://stackoverflow.com/questions/3597781/dr-racket-problems-with-sicp in #lang racket if possible 23:47 Lajla: lewis1711, you can actually change that in options 23:47 Lajla: Somewhere 23:47 Lajla: ability to redefine stuff. 23:47 Lajla: As far as I know, it's not the property of any #lang 23:47 lewis1711: I seem to be able to change it for the options of some languages 23:47 lewis1711: oh 23:47 Lajla: In the language panel, you need to disable "disallow redefinition of initial bindings." This fixes the issue. 23:48 Lajla: It seems someone was just as smart as I. 23:48 (quit) parcs: Ping timeout: 240 seconds 23:49 lewis1711: I have tried that 23:49 lewis1711: there is that option for a few language 23:49 lewis1711: but not racket. even though racket isn't in the list of languages you can choose. which is confusing 23:49 (join) parcs 23:50 Lajla: Hmm, really. 23:50 Lajla: I guess that it's just not part of the racket language then 23:50 Lajla: with could reason though 23:50 Lajla: lewis1711, you can always use set! I guess. 23:51 lewis1711: huh? 23:51 Lajla: (set! + 3) 23:51 lewis1711: i want to disable it, not enable it 23:51 Lajla: ahh 23:51 Lajla: I see 23:51 lewis1711: as in, redefining stuff like eval and + should be VERBOTEN 23:51 Lajla: Let me just see 23:51 lewis1711: or at least a warning 23:51 Lajla: Ja, das ist onsinn 23:51 Lajla: Na klar 23:52 Lajla: Schlechtes programierarbeit 23:54 Lajla: CAn't find it, I suuck. 23:54 lewis1711: me too 23:54 lewis1711: I am a paranoid programmer, and I can't sleep if I know I may be accidentally redefining things that already exist 23:54 lewis1711: it doesn't let me do it in r6rs mode, but then I miss out on lots of racket goodness 23:55 Lajla: lewis1711, well, it's okay, because it won't break any code, your redefinitions are more like letrec. 23:55 Lajla: It only applies in the code you write. 23:55 lewis1711: it's not ok. it's not ok at all 23:55 Lajla: Yes it is. 23:55 Lajla: It's actually very okay that they let you do this. 23:55 Lajla: Else it would mean that if someone named some function you never use in a common name. 23:55 lewis1711: I don't want them to let me. I need boundaries! 23:55 Lajla: No one else would be able to use that name later. 23:56 Lajla: lewis1711, see it like a letrec. 23:56 Lajla: You're not re-defining anything. 23:56 Lajla: You're making a local binding. 23:56 Lajla: THat just shadows the old 23:56 Lajla: that still exists. 23:56 lewis1711: I can still do it top level 23:56 Lajla: Yeah 23:56 Lajla: and it will still be more like a letrec. 23:57 Lajla: Any earlier code or libraries you import won't see your redefinition 23:57 lewis1711: also, I can't do this 23:57 lewis1711: (define x 3) 23:57 lewis1711: (define x 4) 23:57 lewis1711: which is good 23:57 Lajla: Why not? 23:57 Lajla: Why can't you deine x as 3? 23:57 lewis1711: module: duplicate definition for identifier in: x 23:57 Lajla: Ahhh 23:57 Lajla: duplicate. 23:57 lewis1711: I guess that's a warning 23:57 Lajla: Yeah, that's good 23:57 lewis1711: yeah I just want something like that 23:57 lewis1711: for eval, cons, +, etc 23:57 Lajla: Well, that would be a pain for you. 23:57 Lajla: lewis1711, there are much more things than eval and cons and +. 23:57 Lajla: There are so many names of functions that you never used. 23:58 Lajla: Or need to know of. 23:58 Lajla: Because they're completely specific. 23:58 lewis1711: ok sure 23:58 lewis1711: but I'd rather have a warning 23:58 lewis1711: I have TSPL and it's a big book 23:58 lewis1711: but yeah 23:58 Lajla: Well, you can rewrite define as a macro. 23:59 Lajla: With some exception system I guess which first checks if it's already defined