00:14 (quit) jyc: Remote host closed the connection 00:17 (quit) jonrafkind: Ping timeout: 245 seconds 00:21 (join) jyc 01:01 (quit) billyoc: Quit: unicode me 01:09 (join) billyoc 01:25 (quit) billyoc: Read error: Connection reset by peer 01:27 (join) scott_ 01:27 (quit) scott_: Changing host 01:27 (join) scott_ 01:31 (quit) jeapostrophe: Ping timeout: 248 seconds 01:49 (quit) scott_: Read error: Connection reset by peer 02:03 (join) scott_ 02:03 (quit) scott_: Changing host 02:03 (join) scott_ 02:03 (quit) scott_: Read error: Connection reset by peer 02:04 (join) scott_ 02:04 (quit) scott_: Changing host 02:04 (join) scott_ 02:04 (quit) scott_: Read error: Connection reset by peer 02:05 (join) scott_ 02:05 (quit) scott_: Changing host 02:05 (join) scott_ 02:14 (quit) scott_: Quit: Leaving 02:25 (join) scott_ 02:25 (quit) scott_: Changing host 02:25 (join) scott_ 02:40 (quit) skarpy: Remote host closed the connection 02:41 (join) skarpy 03:08 (join) poisonarms 03:15 (quit) cdidd: Remote host closed the connection 04:02 (quit) bjz: Quit: Leaving... 04:04 (join) bjz 04:08 (join) jesyspa 04:38 (quit) bjz: Quit: Leaving... 04:47 (join) Jeanne-Kamikaze 04:51 (quit) bremner: Ping timeout: 246 seconds 04:58 (quit) mithos28: Quit: mithos28 05:03 (join) MayDaniel 05:04 (join) bremner 05:04 (quit) bremner: Changing host 05:04 (join) bremner 05:12 (quit) bremner: Ping timeout: 246 seconds 05:16 (join) bremner 05:16 (quit) bremner: Changing host 05:16 (join) bremner 05:50 (quit) jyc: Remote host closed the connection 06:13 (quit) scott_: Quit: Leaving 06:40 (join) cdidd 06:41 (join) bjz 06:46 (quit) MayDaniel: Read error: Connection reset by peer 06:50 (join) add^_ 07:35 (quit) add^_: Quit: add^_ 07:39 (join) add^_ 07:44 (quit) tfb: Ping timeout: 240 seconds 07:51 (join) tfb 07:53 (join) masm 07:57 (join) bitonic 08:39 (quit) tfb: Ping timeout: 244 seconds 08:40 (join) Haffe 08:40 Haffe: Hi. How does references work in RACKET? 08:41 Haffe: I want to be able to refer to the same object at two different places. 08:41 bremner: Haffe: roughly speaking, references are like single element vectors 08:43 bremner: oh, and I guess you might want to search for "box" 08:44 (join) getpwnam 08:45 (join) hash_table 08:50 bremner: you have have to de-reference with "unbox" and update with "set-box!" 08:50 bremner: rudybot: init racket 08:50 rudybot: bremner: your sandbox is ready 08:51 bremner: rudybot: eval (define foo (box 1)) 08:51 rudybot: bremner: Done. 08:51 bremner: rudybot: eval (set-box! foo 2) 08:51 rudybot: bremner: Done. 08:51 bremner: rudybot: eval (unbox foo) 08:51 rudybot: bremner: ; Value: 2 09:18 (quit) add^_: Quit: add^_ 09:20 Haffe: Ok. 09:22 Haffe: My original problem is that I have an instance of an object that I want to acsses in different functions. 09:22 Haffe: In this case a keyboard-handler and a canvas and a collision detector. 09:23 Haffe: If I use box and unbox. Will this work properley? 09:27 Haffe: Is there a more functional style of doing this? 09:39 (join) carleastlund 09:53 (quit) Haffe: Quit: WeeChat 0.3.2 09:53 (quit) Draggor: Ping timeout: 245 seconds 09:54 (join) Draggor 10:02 (join) jeapostrophe 10:02 (quit) jeapostrophe: Changing host 10:02 (join) jeapostrophe 10:30 (quit) bjz: Quit: Leaving... 10:31 (join) Haffe 10:36 (join) MayDaniel 10:47 bremner: Haffe: do you need mutation? 10:56 (quit) masm: Read error: Operation timed out 10:58 (join) masm 11:06 (quit) bremner: Ping timeout: 246 seconds 11:07 (join) bremner 11:07 (quit) bremner: Changing host 11:07 (join) bremner 11:13 (quit) bremner: Ping timeout: 268 seconds 11:16 (join) bremner 11:16 (quit) bremner: Changing host 11:16 (join) bremner 11:18 (quit) jeapostrophe: Ping timeout: 252 seconds 11:26 Haffe: I have to think about it. 11:26 Haffe: What I am doing is building a small game using object oriented development, and the player pieces are represented as objects. 11:27 Haffe: The player piece objects are stored in a draw-queue of a canvas. The player pieces also have to respon to keyboard interaction. 11:27 Haffe: So, I guess will have to be able to mutate. 11:29 (join) anRch 11:30 bremner: once you do mutation, I'm not sure what you would want as "more functional"; essentially the box notation just splits out the two kinds of de-references one usually has for references, as a value and an as an lvalue (assignment target) 11:31 Haffe: I read up on it on google and got the advice that often the software should be redisgned if it runs into these kind of problems. 11:32 bremner: Haffe: why not use one of the object systems supported by racket? 11:32 Haffe: bremner: I am using the build in. 11:32 Haffe: I.e. with send and such. 11:32 bremner: I guess I don't have enough practical experience with OO racket to really understand the problem. 11:33 bremner: hopefully somebody else will come along later who can give you more practical advice. 11:34 Haffe: I am building a pong clone. I have modeled it so the paddles are of one class, the ball is of another class and the canvas that does the drawing is of a third. 11:34 Haffe: Now the canvas hold the paddles and the ball in a draw-queue. 11:34 Haffe: But I need to be able to acces the actuall paddles from my key-handler. 11:36 (quit) Jeanne-Kamikaze: Quit: Did you hear that ? 11:36 bremner: can't you also store them in some (semi)-global variable? 11:37 Haffe: I guess I could use a mixin in the canvas class to define some data members. 11:39 Haffe: Then I have one more question. 11:39 Haffe: What is the difference between an init, an init-field and a field? 11:59 (quit) anRch: Quit: anRch 12:08 (join) `micro 12:09 _gcr: Haffe: so init defines keywords that you may use in the rest of your class definition 12:09 _gcr: Haffe: so you can effectively set up parameters when you create the class 12:10 _gcr: Haffe: a "field" is a keyword that's accessible outside the class, like a "member" in other languages 12:10 _gcr: Haffe: the "init-field" form combines these two ideas, creating a field that both acts as a field/member, and is settable like an init keyword when you create instances of that class 12:10 (join) jonrafkind 12:11 Haffe: Ok, thanks. 12:12 (join) yoklov 12:26 yoklov: so, generics tend to be named gen:generic-name ? 12:26 (quit) rapacity: Read error: Connection reset by peer 12:28 asumu: yoklov: yes, because the define-generics form automatically prepends the `gen:`. 12:28 yoklov: oh 12:28 yoklov: i see. 12:42 (quit) jesyspa: Ping timeout: 240 seconds 12:42 (join) mithos28 12:43 (join) jesyspa 13:06 (join) jao 13:06 (quit) jao: Changing host 13:06 (join) jao 13:16 poisonarms: This should technically work, yea? http://pastebin.com/2KLiXyg3 - Although, syntacitcally, it keeps complaining about my `if` structure. 13:17 mithos28: your if has 4 parts 13:17 poisonarms: Can I not perform a block of code as my second half of the if? 13:17 poisonarms: Can I only perform 1 instruction? 13:17 mithos28: you need a begin if you want that 13:18 mithos28: (if cond true-branch (begin false-branch1 false-branch2)) 13:18 poisonarms: Thank you. 13:18 mithos28: otherwise how does if know that you want 2 expressions in the false branch and not in the true branch 13:19 poisonarms: I don't know...magic? Ha. Never schemed before. 13:20 mithos28: Well we are very willing to help here. When you run into more issues just ask again. 13:21 poisonarms: Thanks. 13:50 (join) neilv 14:29 (quit) _gcr: Remote host closed the connection 14:32 (join) add^_ 14:37 (quit) mithos28: Read error: Connection reset by peer 14:38 (join) mithos28_ 14:44 (join) Jeanne-Kamikaze 15:07 (join) Nisstyre_ 15:08 (quit) Nisstyre_: Remote host closed the connection 15:08 (join) Nisstyre_ 15:22 asumu: poisonarms: you could also just use `cond` if you want more than one expression. 15:22 asumu: `cond` is also nice because you can use `define` in each branch. 15:23 poisonarms: I see 15:25 (quit) poisonarms: Quit: Computer has gone to sleep 15:26 (quit) mithos28_: Quit: mithos28_ 15:29 (join) jyc_ 15:34 (join) mithos28 15:55 (quit) Shviller: Ping timeout: 268 seconds 15:55 (join) Shviller 15:55 mithos28: Does TR not support higher kinded polymorphism? (define-type (App F y) (F y)) 16:20 (quit) mithos28: Remote host closed the connection 16:21 (join) mithos28 16:30 (quit) jonrafkind: Ping timeout: 240 seconds 16:34 (quit) yoklov: Quit: computer sleeping 16:34 (join) jeapostrophe 16:34 (quit) jeapostrophe: Changing host 16:34 (join) jeapostrophe 16:42 (quit) jeapostrophe: Ping timeout: 246 seconds 16:44 (join) yoklov 17:14 (join) korkyra 17:22 korkyra: Are there any conservative, rigid right-winger out there (beside M. Felleisen)? (For an explanation of this "stupid" question, see the bottom of his home page: http://www.ccs.neu.edu/home/matthias/ ). I had previously thought that the computer scientist are somewhat smarter than the others, but apparently it is not so ... lol 17:27 neilv: the romney/ryan campaign button? 17:28 neilv: that realm of racket silhouette boy looks depressed 17:28 neilv: or possibly urinating and watching his aim 17:29 (quit) korkyra: Ping timeout: 245 seconds 17:36 (quit) MayDaniel: Read error: Connection reset by peer 17:43 (quit) add^_: Quit: add^_ 17:43 (join) add^_ 17:59 (quit) karswell: Remote host closed the connection 18:06 (join) jeapostrophe 18:06 (quit) jeapostrophe: Changing host 18:06 (join) jeapostrophe 18:06 (quit) Jeanne-Kamikaze: Quit: Did you hear that ? 18:08 (join) poisonarms 18:09 (join) karswell 18:21 (quit) jeapostrophe: Ping timeout: 248 seconds 18:24 asumu: Let's keep politics out of #racket. 18:26 (join) jeapostrophe 18:26 (quit) jeapostrophe: Changing host 18:26 (join) jeapostrophe 18:31 neilv: s/he already left 18:33 (quit) add^_: Quit: add^_ 18:34 (quit) Shviller: Ping timeout: 255 seconds 18:36 (quit) jeapostrophe: Ping timeout: 240 seconds 18:39 (join) jonrafkind 18:39 (quit) jonrafkind: Changing host 18:39 (join) jonrafkind 18:46 (join) jackhammer2022 18:56 (join) bjz 18:56 (quit) karswell: Remote host closed the connection 19:01 (join) karswell 19:11 (part) carleastlund 19:13 (join) dnolen 19:32 (quit) jesyspa: Quit: leaving 19:33 (join) scott_ 19:33 (quit) scott_: Changing host 19:33 (join) scott_ 20:00 (quit) karswell: Remote host closed the connection 20:05 poisonarms: Whelp...It KIND of works, hahaha: http://ideone.com/WfWba 20:07 mithos28: You want snoc, not cons there. But since its not a standard library function, you'll have to implement it yourself 20:07 mithos28: snoc is cons backwards, and adds to the end of the list 20:07 (join) random_malice 20:08 (quit) scott_: Quit: Leaving 20:09 (join) scott_ 20:09 (quit) scott_: Changing host 20:09 (join) scott_ 20:10 (quit) getpwnam: Ping timeout: 260 seconds 20:10 (join) karswell 20:10 (quit) hash_table: Quit: No Ping reply in 180 seconds. 20:11 (join) hash_table 20:22 poisonarms: How terrible is embedding recursion within recursion? 20:22 mithos28: Its fine 20:23 mithos28: The issue is with the running time, but don't worry about that at first 20:23 mithos28: I'm assuming you are still working on reverse 20:23 poisonarms: Yes. 20:24 mithos28: The first solution you come up with, will probably be O(n^2) where n is the length of the list 20:25 poisonarms: The mindset of working from the tail to the head is hard to get into. 20:27 poisonarms: But so is recursion. 20:27 poisonarms: Headache inducing. 20:29 poisonarms: http://ideone.com/IWIyj 20:30 mithos28: what does last-element do? 20:30 poisonarms: Returns the last element of a list. 20:31 mithos28: ok, what type of value does it return 20:31 poisonarms: (car ls) 20:31 mithos28: Is that a list? 20:31 poisonarms: Guess not. 20:32 mithos28: ok, what type does reverse require its argument to be 20:32 poisonarms: List. 20:32 poisonarms: So if I return (list (car ls)) 20:33 poisonarms: But then I get "Expected: pair?, given: '()" 20:35 mithos28: I think replacing your ifs with conds might help, because then you will see your errors closer to where you are making them 20:35 mithos28: so instead of (if (null? ls) x y), (cond ((null? ls) x) ((pair? ls) y)) 20:37 poisonarms: Well, it's my first delve into Scheme, functional programming and recursion all at once, over the course of the past few days, ha. That also might have something to do with it. Usually program in C like languages. 20:37 poisonarms: But I'll give it a try. 20:37 mithos28: Are you following a book or tutorial? 20:37 (quit) scott_: Quit: Leaving 20:38 poisonarms: Mmmm...yes/no? I'm reading the Racket docs and watching the SICP lectures in between fooling around. 20:38 mithos28: http://www.ccs.neu.edu/home/matthias/HtDP2e/ 20:41 poisonarms: So last-element becomes: http://pastebin.com/uXmP7WA8 ? 20:42 mithos28: what is the last-element of null 20:44 (join) scott_ 20:44 (quit) scott_: Changing host 20:44 (join) scott_ 20:44 poisonarms: I guess it SHOULD be null, because null is null, it doesn't have one. 20:45 mithos28: I would say it is an error not null. Null is the empty list not the null from java or C. 20:45 mithos28: Usually one uses the names empty and empty? instead of null and null? 20:46 poisonarms: I've been using null and null? for the sake of using ideone.com for pasting :P 20:46 mithos28: oh, because it will evaluate it? 20:46 poisonarms: Yea 20:47 bremner: rudybot: init racket 20:47 rudybot: bremner: your sandbox is ready 20:47 bremner: rudybot: eval null 20:47 rudybot: bremner: ; Value: () 20:50 (quit) asumu: Quit: leaving 20:51 poisonarms: Oi, I think I'll take a break. 20:52 (quit) masm: Quit: Leaving. 20:55 (join) Kaylin 21:04 (join) jeapostrophe 21:04 (quit) jeapostrophe: Changing host 21:04 (join) jeapostrophe 21:06 (join) asumu 21:15 (quit) jeapostrophe: Ping timeout: 244 seconds 21:19 (quit) asumu: Changing host 21:19 (join) asumu 21:27 (quit) bjz: Quit: Leaving... 21:37 (join) Enoria 21:39 (join) billyoc 21:44 (quit) neilv: Quit: Leaving 21:46 (quit) jao: Ping timeout: 246 seconds 21:59 (join) juanfra 22:24 (quit) juanfra: Quit: juanfra 22:29 (join) bob___ 22:29 (part) bob___ 22:37 (join) y5h 22:40 (quit) mithos28: Quit: mithos28 22:41 (quit) y5h: Client Quit 22:42 (join) mithos28 23:05 (quit) Kaylin: Read error: Connection reset by peer 23:11 (quit) billyoc: Read error: Connection reset by peer 23:12 (join) billyoc 23:37 (quit) hash_table: Ping timeout: 252 seconds 23:37 (quit) random_malice: Ping timeout: 260 seconds 23:38 (join) bjz 23:44 (join) cataska