00:04 (quit) rudybot: Remote host closed the connection 00:34 (join) rudybot 00:38 (quit) dnolen: Read error: Connection reset by peer 00:39 (join) saint_cypher2 00:41 (join) dnolen 00:42 (quit) saint_cypher1: Ping timeout: 260 seconds 00:45 (quit) saint_cypher2: Remote host closed the connection 00:46 (join) saint_cypher1 01:18 (quit) dnolen: Quit: dnolen 01:32 (join) jonrafkind 01:56 (join) saint_cypher2 01:56 (quit) saint_cypher1: Quit: Leaving. 02:09 (join) saint_cypher1 02:11 (quit) saint_cypher2: Ping timeout: 250 seconds 02:50 (quit) saint_cypher1: Ping timeout: 264 seconds 02:50 (quit) jonrafkind: Ping timeout: 264 seconds 03:08 (join) lucian 03:08 (quit) lucian: Remote host closed the connection 03:09 (join) lucian 03:37 (quit) lucian: Remote host closed the connection 04:20 (join) jao 04:20 (quit) jao: Changing host 04:20 (join) jao 06:08 (quit) saint_cypher: Quit: Leaving. 06:15 (quit) imran_sr: Quit: Leaving 07:21 (join) masm 07:21 (join) tauntaun 07:23 tauntaun: We are taught to write + rather than (lambda (x y) (+ x y)). What is the best name for this transformation? Is it "currying"? Or is it "beta-reduction"? Or is it something else? 07:25 tauntaun: ... 07:25 jao: eta (not beta) reduction, i think. 07:29 tauntaun: thx 07:30 tauntaun: So would you say that currying is something like the inverse of eta-reduction? 07:32 bremner: isn't currying something to do with (lamda (x) (lambda (y) (+ x y))) ? 07:37 Lajla: No, currying is doing (+ 3) in a language that supports it 07:38 Lajla: currying is I believe an informal notion 07:38 Lajla: At least, when people say 'currying', they rarely seem to mean 'make a function curryable' 07:41 tauntaun: currying is very clearly defined. 07:41 tauntaun: The Racket implementation makes that clear. 07:41 tauntaun: The Racket documentation makes it clearer. 07:41 jao: that's partial application (+ 3) 07:41 tauntaun: jao: yes. 07:41 tauntaun: But my question is: 07:41 jao: currying is transforming an n-arg function into a 1-arg function 07:41 tauntaun: jao: yes again. 07:41 tauntaun: But my question is 07:42 tauntaun: Is it appropriate to think of currying as an inverse operation to eta-reduction? 07:48 Lajla: jao, pending literature, currying is the same thing as partial application. 07:48 Lajla: And 'partial application' is a very vague thing. 07:48 Lajla: the 'curryable +' is of course simply a one-argument function 07:48 Lajla: Its application is no more or less partial than that of any function which returns another function 07:49 (quit) jao: Ping timeout: 272 seconds 07:55 Lajla: tauntaun, to get to that point, I don't think it is. 07:55 Lajla: Curryizing + is (lambda (x) (lambda (y) (+ x y)) 07:56 Lajla: Not (lambda (x y) (+ x y)) 07:56 (quit) tauntaun: Quit: Ex-Chat 08:42 (quit) masm: Ping timeout: 276 seconds 08:46 (join) masm 09:12 (join) dnolen 09:30 (join) Dranik 09:54 (join) jao 09:54 (quit) jao: Changing host 09:54 (join) jao 10:18 (join) MayDaniel 10:26 (join) mceier 10:35 (join) tauntaun 10:39 clklein: Lajla: FWIW, in the definitions I've heard, curry : (a x b -> c) -> (a -> b -> c) and part-app : (a x b -> c) x a -> (b -> c) 10:39 Lajla: clklein, what does FWIW stand for? 10:39 Lajla: for what I ...? 10:39 clklein: Racket's `curry' does currying and partial application. 10:39 Lajla: For what it's worth? 10:39 clklein: yes, "for what it's worth" 10:39 Lajla: clklein, I guess the thing with terminology is that it's of course never objectively right and wrong. 10:40 Lajla: I've mostly seen 'currying' used in the same sense as partial application (which is a vague concept I would say) 10:40 tauntaun: Lajla: you keep saying currying is vague. Could you please demonstrate with an example? 10:40 tauntaun: jao defined these terms very clearly earlier. 10:41 Lajla: tauntaun, I said partial application is vague 10:41 tauntaun: thank you. Example? 10:41 Lajla: if you want to say that partial application is a different concept to currying it needn't be. 10:41 tauntaun: Explanation? 10:41 Lajla: tauntaun, give me a formal definition of partial application 10:41 Lajla: jao, defined what I would call 'make curryable 10:41 Lajla: Whic was not partial application 10:42 tauntaun: When an n-ary function is invoked with m arguments, with m < n. 10:42 Lajla: tauntaun, well, guess what, a curryable function always is single argument 10:42 tauntaun: we're not talking about curry. 10:42 Lajla: tauntaun, you know that in Haskell or lambda calculus all functions are single-argument right? 10:42 tauntaun: YES! 10:43 tauntaun: You seem to be avoiding the question. 10:43 Lajla: Well, if all functions are single argument 10:43 Lajla: then what does your definition say? 10:43 Lajla: Every function is 1 arry 10:43 Lajla: So M cannot be < n 10:43 tauntaun: Oh God. 10:43 tauntaun: I can't believe you're fussing about this. 10:44 (nick) tauntaun -> tautaun_away 10:51 (quit) dnolen: Quit: dnolen 11:03 (nick) tautaun_away -> tautaun 11:05 (join) jasond` 11:08 (join) anRch 11:13 jasond`: does anybody know why the turtles library produces occasional 1-pixel offsets? example: http://98.129.169.48/tmp/turtles.png 11:31 (quit) jao: Ping timeout: 250 seconds 11:38 (quit) Dranik: Ping timeout: 240 seconds 11:44 (quit) tautaun: Ping timeout: 264 seconds 11:54 (quit) MayDaniel: Read error: Connection reset by peer 11:57 (join) sstrickl 12:09 (join) misterm 12:24 (quit) anRch: Quit: anRch 12:29 (join) jonrafkind 12:41 (join) tauntaun 12:42 (join) anRch 13:10 (join) lucian 13:10 (quit) tauntaun: Quit: Ex-Chat 13:15 (quit) anRch: Quit: anRch 13:21 (quit) Demosthenes: Read error: Operation timed out 13:30 (join) Demosthenes 13:44 (join) lucian_ 13:47 (quit) lucian: Ping timeout: 260 seconds 13:48 (nick) lucian_ -> lucian 14:08 (join) PLT_Notify 14:08 PLT_Notify: racket: master Matthew Flatt * ec2a917 (5 files in 2 dirs): Scribble: add `#:left?' optional argument to `margin-note' 14:08 PLT_Notify: racket: master Matthew Flatt * 4afd36c (3 files in 2 dirs): openssl: use libcrypto and libssl version 1.0 if available ... 14:08 PLT_Notify: racket: master commits 68b5d2a...4afd36c - http://bit.ly/fc4UOp 14:08 (part) PLT_Notify 14:18 (join) lucian_ 14:21 (quit) lucian: Ping timeout: 264 seconds 14:26 (quit) em: Ping timeout: 260 seconds 14:32 (quit) jasond`: Remote host closed the connection 14:41 (join) em 14:43 (nick) lucian_ -> lucian 15:00 (join) lucian_ 15:00 (join) mye 15:01 (quit) lucian: Ping timeout: 240 seconds 15:08 (nick) lucian_ -> lucian 16:08 (join) saint_cypher 16:50 (join) _danb_ 17:09 (quit) jonrafkind: Ping timeout: 240 seconds 17:14 (join) tauntaun 17:18 (join) anRch 17:19 (join) jonrafkind 17:28 (quit) jonrafkind: Ping timeout: 260 seconds 18:06 (quit) anRch: Quit: anRch 18:15 (quit) Lajla: Read error: Connection reset by peer 18:16 (join) Lajla 18:21 (join) mye^ 18:24 (quit) mye: Ping timeout: 276 seconds 18:35 (join) danger_ 18:35 danger_: so i have been working on this simple transposition prog could some one tell me why my append isnt working? 18:36 danger_: (define stuff (lambda (x y) (if (null? y) 0) (if (not (null? (car y))) (stuff (append x (list (map car y))) (map cdr y))) )) (define x '()) (define y '(( 1 2 3 4 )( 4 5 6 7 )( 7 8 9 0 ))) (stuff x y) 18:36 danger_: any one here? 18:38 (join) jonrafkind 18:38 danger_: ... 18:40 danger_: do i not know something or do people not talk 18:51 jonrafkind: talking is forbidden 18:51 danger_: i see 18:52 danger_: so i guess no one could answer my questions here 18:52 danger_: know any place were i could ask them 18:52 jonrafkind: whats your question 18:53 danger_: i was haveing an issue with the append statment 18:54 danger_: heres my code 18:54 danger_: (define stuff (lambda (x y) (if (null? y) 0) (if (not (null? (car y))) (stuff (append x (list (map car y))) (map cdr y))) )) (define x '()) (define y '(( 1 2 3 4 )( 4 5 6 7 )( 7 8 9 0 ))) (stuff x y) 18:54 danger_: it works fine if you look at the debug 18:54 danger_: sept for the append 18:55 danger_: the most frustrating mystery indeed 18:56 jonrafkind: did you mean to put a ) after the 0 in (null? y) ? 18:56 jonrafkind: that makes a one-armed if 18:57 danger_: what do you mean one armed? 18:57 jonrafkind: i mean there is no else branch, just a then 18:57 jonrafkind: its usually (if ) 18:57 jonrafkind: you just have (if ) with no 18:58 danger_: mmm ok so i tried deleting that check 18:58 jonrafkind: it looks like you want to use cond instead 18:59 jonrafkind: how are you running this prorgam? 18:59 danger_: the (if (null? y) 0) 18:59 danger_: and i get the same results 18:59 jonrafkind: what result exactly 18:59 danger_: nothing xD 18:59 danger_: nothing prints 18:59 jonrafkind: how are you running this program? 18:59 danger_: everything appears to work tell it gets to the append statmetn 19:00 danger_: im running it in racket 19:00 jonrafkind: in a student language? 19:00 danger_: yes 19:00 danger_: essentials of prog lang 3 19:00 jonrafkind: do you have a description of `cond' around 19:01 danger_: yes 19:01 jonrafkind: do you understand how to use it? 19:01 danger_: i believe so 19:01 danger_: (cond (expression)) 19:02 danger_: thats an abridged version 19:02 jonrafkind: well.. its (cond (condition expression) ...) 19:03 danger_: yep 19:03 danger_: just edited 19:03 danger_: (define stuff (lambda (x y) (cond ((not (null? (car y))) (stuff (append x (list (map car y))) (map cdr y))) ))) 19:03 danger_: get the same results 19:03 danger_: it works in apperence when you look at the debug 19:03 danger_: but it doesnt ever append anything to the x 19:04 jonrafkind: what if (car y) is null? 19:04 danger_: if car y is null it just stops 19:04 danger_: meaning if the list is empty it shouldnt recurse again 19:05 jonrafkind: so whats the return value if car y is null? 19:05 jonrafkind: do you realize that append does not mutate x? 19:05 jonrafkind: rudybot: (define x '(1)) 19:05 rudybot: jonrafkind: your sandbox is ready 19:05 rudybot: jonrafkind: Done. 19:06 jonrafkind: rudybot: (append x '(2)) 19:06 rudybot: jonrafkind: ; Value: (1 2) 19:06 jonrafkind: rudybot: x 19:06 rudybot: jonrafkind: ; Value: (1) 19:06 danger_: wait im confused 19:06 danger_: so why doesnt the append take the x list and add the y to the end 19:07 danger_: of x* 19:07 jonrafkind: it does but it returns a new list, it does not modify the x variable 19:08 jonrafkind: you want something like in C, x = append(x, y); thats not how it works in scheme 19:08 danger_: mmm i thought about that too but as you see it should transfer it to the next iteration 19:08 jonrafkind: it does 19:08 jonrafkind: now what happens when (car y) is null? 19:09 danger_: the way i assume it works is: (append x y) (define x '(3)) (define y'(4)) the new x should be (3 4) 19:10 jonrafkind: thats not how it works 19:10 danger_: mmmm 19:10 jonrafkind: (append x y) makes a new list 19:10 jonrafkind: it does not modify x 19:10 danger_: le sigh 19:10 jonrafkind: by 'new x' do you mean after recursion? 19:10 danger_: no i mean its added to the old definition 19:11 danger_: but i see where im wrong 19:11 danger_: how can i fix this append issue 19:11 danger_: meaning how can i add something to a current list 19:12 jonrafkind: you need to define your program in terms of recursion (which you already have done) but you haven't fully grasped how to pass values in a recursive program 19:12 jonrafkind: you dont need to add things to the current list, you can return a new list 19:12 danger_: mmmm 19:12 danger_: ... 19:13 jonrafkind: what is 'stuff' supposed to return? 19:13 danger_: ok 19:13 danger_: stuff should transpose the matrix 19:13 danger_: i just dont have the best name xD 19:13 danger_: i suppose i could change it to transpose 19:13 jonrafkind: ok if (car y) is not null it returns the intended thing, right? 19:14 danger_: yes 19:14 danger_: i think 19:14 jonrafkind: ok so now if (car y) is null what odes it return 19:14 danger_: it thows an error in runtime 19:14 danger_: wait 19:14 danger_: one sec 19:14 jonrafkind: can you cahnge it so that if (car y) is null it returns the intended result? 19:15 danger_: what the car y is suposed to do is check to see if the y matrix is empty 19:15 danger_: if it isnt empty it should do the append and recurse 19:16 jonrafkind: so what if it is empty? 19:16 danger_: it just ends i suppose (skips the statment) 19:16 jonrafkind: and then what 19:17 danger_: i would like it to print the transposed matrix 19:17 danger_: but right now nothing happens 19:17 jonrafkind: if the function doesn't return anything how will you get the matrix to transpose? 19:18 jonrafkind: if none of the cond clauses execute you get 'void' back 19:18 danger_: so what your saying is i should have a "print statment" on a void 19:19 jonrafkind: you can try it, but thats not what im saying 19:19 jonrafkind: stuff(x) will return the transposition of `x' right? 19:20 danger_: its display right? 19:20 danger_: yes 19:20 jonrafkind: ok so you make a recursive call there if y is not empty, so you do stuff(x,y) = stuff(append(x, ...), ...), right? 19:20 danger_: oh shit it worked xD 19:20 danger_: with the display 19:20 danger_: lol 19:20 danger_: thanks alot 19:20 danger_: a lot* 19:20 danger_: not the animal 19:21 danger_: xD 19:21 jonrafkind: well yes it will work but your program is still wrong 19:21 jonrafkind: try printing the result of `stuff' 19:21 jonrafkind: (display (stuff x y)) 19:21 danger_: in stuff? 19:21 jonrafkind: no outside stuff 19:21 danger_: kk 19:21 danger_: still works 19:21 jonrafkind: no, you still have the display inside stuff 19:21 jonrafkind: take that out 19:21 danger_: kk 19:22 danger_: void 19:22 jonrafkind: yes 19:22 jonrafkind: now look at this, stuff(x, y) = stuff(append(x, ...), ...), right? 19:22 danger_: im not sure i understand what you mean 19:23 jonrafkind: its the recursive call you are making. do you know what recursion is? 19:23 danger_: yes 19:23 danger_: ok ok i seee 19:23 danger_: xD 19:23 jonrafkind: so that equivalence is made when (car y) is not null, right? 19:24 danger_: ok.. 19:24 jonrafkind: so then what if (car y) is null? what is stuff(x, y) ? 19:25 danger_: well x is always null if you look at the debug and y is (()()()()) 19:26 jonrafkind: what is the result of (stuff '(1) '(())) ? 19:26 jonrafkind: what will stuff return? 19:26 (join) lithpr 19:26 danger_: well it would return nothing 19:26 danger_: nothing would happen 19:26 jonrafkind: so is nothing the transposed matrix? 19:27 danger_: yes beacuse the first argument should always be empty and thus when a empty matrix is transposed it will be nothing 19:27 danger_: its transposing y 19:27 jonrafkind: i mean, (stuff x y) = (stuff (append x ...) null) = void, right? 19:27 danger_: i was trying to put it in x 19:27 danger_: yes 19:27 jonrafkind: so (stuff x y) = void, is that what you want? 19:28 danger_: thats fine by me ... what i wanted it to do was put the transpose of y in to x 19:28 danger_: so i could print out x 19:28 jonrafkind: you cant do that 19:28 jonrafkind: you can only return new values of x 19:28 (quit) shachaf: Ping timeout: 272 seconds 19:28 danger_: i see 19:29 (join) shachaf 19:29 jonrafkind: outside of stuff do (display x), it will still be '() 19:29 jonrafkind: the x variable inside stuff is a different variable from outside 19:29 danger_: thats alright with this but is there a way where i could get it in x for further refrence 19:29 jonrafkind: which x, the one outside? 19:29 danger_: yes 19:29 jonrafkind: you could do (set! x (stuff x y)) 19:30 danger_: ah set 19:30 (quit) sstrickl: Quit: sstrickl 19:30 jonrafkind: a better way is (let ([x (stuff x y)]) (display x) 19:30 danger_: i was just about to learn that one 19:30 jonrafkind: generally mutation is bad 19:30 danger_: i seriously have it on my list next 19:30 danger_: of things to do 19:30 jonrafkind: you should take it off your list 19:30 danger_: noted 19:30 danger_: notted* 19:31 danger_: ffff 19:31 danger_: i can never spell 19:31 danger_: so i have one last question 19:31 danger_: well 2 19:31 danger_: how old do you think i am 19:31 danger_: and whats your background? 19:32 jonrafkind: are these homework questions? 19:32 danger_: no lol just mine 19:32 jonrafkind: im a graduate student 19:33 danger_: fun stuff 19:33 danger_: im a senior :P about to be a grad student specializing in security 19:33 danger_: in cs 19:34 danger_: well thanks for your help 19:36 jonrafkind: word 19:37 (quit) danger_: Quit: Page closed 19:41 (quit) saint_cypher: Quit: Leaving. 20:03 (join) greg___ 20:03 greg___: Hello? 20:04 jonrafkind: hi 20:06 greg___: This is the chat room for programing in scheme, right? 20:06 jonrafkind: yea 20:08 greg___: I'm trying to figure out how to iteratively append a list of values from a list of dotted pairs (using the x coordinate of the pair) 20:08 greg___: Newbie 20:09 tauntaun: you mean '((a . b) (c . d) (e . f)) => '(a b c d e f) ? 20:09 jonrafkind: i thought he meant => '(a c e) 20:09 tauntaun: aH 20:09 tauntaun: (curry map car) 20:09 greg___: Yes, what jonrafkind said 20:10 jonrafkind: (map car x) 20:11 greg___: so given the list pt-list => ((a . b)(c . d)(e . f)), (map car pt-list) will return the list (a c e)? 20:11 tauntaun: y 20:12 greg___: aha cool. That makes my life a whole lot easier 20:12 greg___: Thank you 20:13 greg___: Have a nice night 20:13 (quit) greg___: Quit: Page closed 20:26 (quit) lucian: Remote host closed the connection 20:32 (quit) mceier: Quit: leaving 20:34 (join) evhan_ 20:36 (join) burtreynolds 20:36 burtreynolds: sup all? 20:37 (quit) evhan: Ping timeout: 264 seconds 20:39 (quit) jonrafkind: Ping timeout: 240 seconds 20:42 tauntaun: hi burtreynolds 20:45 burtreynolds: It's actually greg again. I'm looking for a way to append a list as before (the x values from a list of dotted pairs) but without using (map car p) 20:45 tauntaun: can you say why? 20:46 tauntaun: mapping car strikes me as the most concise solution 20:46 (join) burtreynolds_ 20:47 burtreynolds_: My apologies my browser crashed momentarily 20:47 tauntaun: did you catch my last two lines? 20:47 burtreynolds_: I'm sorry no 20:48 tauntaun: I'm just wondering why mapping car isn't good enough. 20:50 (quit) burtreynolds: Ping timeout: 272 seconds 20:51 burtreynolds_: It's gonna sound stupid, but its part of the assignment that we can't use it. 20:51 burtreynolds_: I'm a student yet 20:51 (nick) evhan_ -> evhan 20:53 tauntaun: Doesn't sound stupid at all, but without map you'll have to write an explicitly recursive function. Do you know how to write one that simply copies a list? 20:53 burtreynolds_: No. 20:54 tauntaun: (define (copy-me ls) (if (null? ls) '() (cons (car ls) (copy-me (cdr ls))))) 20:54 tauntaun: rudybot: (define (copy-me ls) (if (null? ls) '() (cons (car ls) (copy-me (cdr ls))))) 20:54 rudybot: tauntaun: your sandbox is ready 20:54 rudybot: tauntaun: Done. 20:54 tauntaun: rudybot: (copy-me '(1 2 3)) 20:54 rudybot: tauntaun: ; Value: (1 2 3) 20:55 tauntaun: burtreynolds: If you can understand copy-me, you'll be able to do your assignment without any problems. 20:55 tauntaun: To understand copy-me, try executing it on paper on several lists, starting with the empty list, then a one-element list, then a larger list. 21:00 burtreynolds_: Ok i see, I see... 21:00 burtreynolds_: Now is there a way to convert a list to a string so that I may use a 'max' procedure on it? 21:11 tauntaun: burtreynolds_: not sure what you mean. Could you give an example? 21:26 (quit) tauntaun: Quit: Ex-Chat 21:27 (quit) burtreynolds_: Quit: Page closed 22:11 (quit) masm: Quit: Leaving. 22:18 (join) ^mye^ 22:21 (quit) mye^: Ping timeout: 250 seconds 23:15 (quit) evhan: Quit: leaving 23:53 (quit) mario-goulart: Remote host closed the connection 23:53 (join) mario-go`