00:02 (join) Lajla 00:08 (quit) mheld: Quit: mheld 00:21 (join) mheld 00:38 (quit) mheld: Quit: mheld 01:15 danking: This is gonna sound really stupid but, if I was using racket/class how would I make (send object (if option foo bar)) work the way I'd like it to work? 01:15 danking: That didn't really come out right. How would I write (send object (if option foo bar)) if I didn't want to write a macro or otherwise change the normal way this library works. 01:19 mattmight: list-no-order in match doesn't allow duplicate variables. :( Why not? 01:27 jeapostrophe: danking: with-method is one option and send-generic is the other 01:28 jeapostrophe: mattmight: you would like it to compile st it appears multiple times? 01:28 jeapostrophe: ie (list-no-order x x 4) would match.... (list 4 3 3) (list 4 4 4) (list 'a 4 'a) etc? 01:29 jeapostrophe: and x ... isn't what you want either? 01:35 danking: jeapostrophe: Meh. It's all so... uck. Glad I don't normally deal with OO. 01:35 jeapostrophe: i don't like oo much either 01:36 jeapostrophe: it is so imperative, it rubs me the wrong way 01:36 jeapostrophe: (even though I agree with matthias' argument re oo functional programming, the reality is that our class system mimics java and its imperativeness) 01:42 (join) jonrafkind 01:48 mattmight: jeapostrophe: yeah, (list-no-order x x 4) should match a list which contains 4 and the other two elements the same. (Though, that's not why I need it.) 01:48 jeapostrophe: i imagine that that would be much more expensive than match patterns normally are to compile 01:49 jeapostrophe: but the docs should definitely be updated to mention that if it is not an error 01:49 mattmight: I wanted something like (list-no-order `(last-name ,last-name) `(spouse (app split-name (list spouse-first last-name)))) to match only when the spouse has the same last name. 01:50 mattmight: I checked the docs. It doesn't mention than list-no-order is treated specially. 01:50 jeapostrophe: ya that would be better 01:50 mattmight: But, I can see that the performance penalties could be severe. 01:52 jeapostrophe: I think my "regular expression" match patterns would be able to do that: 01:52 jeapostrophe: https://github.com/jeapostrophe/exp/tree/master/temporal-ctcs 01:52 jeapostrophe: and i compile them pretty well 01:52 jeapostrophe: there are docs 01:52 jeapostrophe: https://github.com/jeapostrophe/exp/blob/master/temporal-ctcs/automata/scribblings/re.scrbl 01:52 rudybot: http://tinyurl.com/3ae23fo 01:52 jeapostrophe: and tests 01:52 jeapostrophe: https://github.com/jeapostrophe/exp/blob/master/temporal-ctcs/tests/automata/re-test.rkt 01:52 rudybot: http://tinyurl.com/2wrc4z8 01:52 jeapostrophe: but maybe not 01:53 jeapostrophe: either way, something you might find fun 01:53 mattmight: Yeah, looks neat. 01:55 Lajla: jeapostrophe, what is matthias' argument/ 01:55 Lajla: That message sends are basically functin calls? 01:57 jeapostrophe: Lajla: http://www.ccs.neu.edu/home/matthias/Presentations/ecoop2004.pdf 01:59 Lajla: jeapostrophe, this is I guess why I think slides and conferences are a bit nonsensical. =( 01:59 Lajla: I find that I have no idea what it is trying to say without Matthias' melodic voice explaining it 02:01 jeapostrophe: the short: 02:01 jeapostrophe: oo was designed to eliminate the need for state 02:01 jeapostrophe: all the original philosophy sounds like functional programming 02:01 jeapostrophe: all the good design techniques people talk about are fp 02:01 jeapostrophe: but if you try to follow them, all the implementations (ie java) are horribly broken 02:01 jeapostrophe: matthias makes a particular case against tail calls 02:02 jeapostrophe: but he gives other examples 02:02 jeapostrophe: this is no surprise given that scheme was invented to study actors (ie oo) 02:02 jeapostrophe: so, the thesis of the talk is that good oo = fp but most oo practitioners don't know that and thus are not good 02:04 Lajla: Hmm 02:04 Lajla: didn't Alan Kay require objects to hold state? 02:05 Lajla: But yeah, when objects always give the same response on the same message,s you have your basic functional programming. 02:05 Lajla: But what I think the difference is is that in Kay OO, object.message is more like object(message); whereas in Java-OO, it's more message(object) 02:14 jeapostrophe: you should try to read matthias' thing 02:14 jeapostrophe: peace out 02:14 (quit) jeapostrophe: Quit: jeapostrophe 02:31 jonrafkind: i think you could write that broken tail-recursive in java using iterators 02:31 jonrafkind: and it would still be OO 02:35 (quit) jonrafkind: Ping timeout: 250 seconds 02:48 danking: My trouble with OO is that it binds my data and my methods. I'd rather have funcitons that do useful things on all sorts of objects without having to create this whole class hierarchy :/. Of course, my only experience with OOP is Java and thus not exactly a top notch experience. 02:49 Lajla: danking, I think that it could be more of a thing of dynamic versus static though. 03:14 (join) zenspider 03:27 zenspider: I'm totally stumped by what should be a very straightforward sicp problem 03:28 zenspider: so far, I'm guessing I'm still missing something and that my tools or something else is wrong... not the book 03:28 zenspider: sicp seems to be hinting that * does vector maths 03:28 zenspider: with this: (define (dot-product v w) (accumulate + 0 (map * v w))) 03:28 zenspider: exercise 2.37 03:29 zenspider: mit's errata mentions nothing wrong about this problem 03:31 Lajla: More that map works on vectors, no? 03:31 Lajla: (map * v w) is your basic zipwidth 03:33 Lajla: Say you have some abstract sequence v := {v1, v2 ...} and some other abstract sequence {w2, w2, ...} then (map f v w) would be a sequence {(f v1 w1), (f v2 w2), ...} 03:33 zenspider: Lajla: right 03:33 Lajla: accumulate seems to be your basic fold here 03:33 zenspider: but that means: 03:33 zenspider: (map * '(1 2 3) '((2 -1 1) (0 -2 1) (1 -2 0))) 03:33 zenspider: would be (* 1 '(2 -1 1)) no? 03:33 zenspider: yeah, it is 03:34 Lajla: That would be an error I believe. 03:34 Lajla: It will try to (* 1 '(2 -1 1)) on you 03:34 Lajla: And say 'Oh nox, * is not defined in lists, what will we do?' 03:34 zenspider: right 03:34 Lajla: And that is what excersie 2.37 tries to do? 03:35 zenspider: so * won't double dispatch to a vector * 03:35 Lajla: Nahh, and this is a list by th way 03:35 Lajla: Not a vector. 03:35 zenspider: well... they define the above dot-product as-is... it is a given 03:35 zenspider: I mean a math vector, not a scheme/lisp vector. sorry. 03:35 Lajla: Then they encode vectors (the mathematical ones) in lists instead of in vectors (the data structure) 03:36 Lajla: Whaddayouknow, great minds think alike 03:36 zenspider: so I'm defining: (define v '(1 2 3)) and (define m '((2 -1 1) (0 -2 1) (1 -2 0))) 03:36 zenspider: and trying: (assert-equal '(3 -1 -3) (dot-product v m)) 03:36 Lajla: Well, then you have to map a dot product on it. 03:36 Lajla: Not a * 03:36 Lajla: Like (map dot-product v m) 03:37 zenspider: Lajla: yes. but. that code is exactly as given in sicp. I doubt it is wrong. 03:37 Lajla: Hmm 03:37 Lajla: I would concur at this juncture. 03:37 Lajla: Strange 03:37 zenspider: that makes a lot more sense... I just don't get why the book says this 03:37 Lajla: I always had the idea that books about lisp were free of error and typos. 03:37 zenspider: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-15.html#%_sec_2.2.3 exercise 2.37 03:37 zenspider: note the footnote 03:38 Lajla: zenspider, it's a liberal conspiracy, trying to pave the way to socialism. 03:38 Lajla: Let me see. 03:38 zenspider: about using the N-way map 03:38 zenspider: haha 03:38 zenspider: I wish 03:40 Lajla: Okay, I'm confuzzled here, but this is because I'm a total noob at any of this. 03:40 Lajla: zenspider, you got my backing though. 03:40 Lajla: THis doesn't seem to make sense. 03:51 zenspider: crap. ok. I found someone's online homework and they're doubling up the vector to fit the matrix. argh 04:03 Lajla: zenspider, what do you mean/ 04:04 zenspider: instead of v being '(1 2 3) it is '((1 1 1) (2 2 2) (3 3 3)) 04:04 zenspider: totally lame 04:05 Lajla: Ahhh 04:05 Lajla: Well, 04:05 Lajla: basically you can't just dot product two vectors of different dimensions as far as I know. 04:06 Lajla: But what do I know, I was a good boy and realized that calculus was the opium of the vulgate a long time ago. 04:06 Lajla: And with that I mean infinitesimal calculus, surely. 04:18 rapacity: you were a boy? 04:19 Lajla: rapacity, a good one even. 04:50 (part) zenspider: "ERC Version 5.3 (IRC client for Emacs)" 17:24 (topic) -: Racket -- http://racket-lang.org/ (logs at http://racket-lang.org/irc-logs/ ) 17:24 (names) -: gabot eli tv|z MayDaniel parcs evhan jonrafkind mceier carleastlund cataska tewk mattmight mario-goulart @ChanServ askhader Quetzalcoatl_ sid3k em martinhex rudybot abbe tonyg fmu clklein danking rotty alexsuraci sethalves rapacity spacebat certainty Guest74073 Demosthenes Lajla bremner_ 18:10 (quit) mceier: Quit: leaving 18:44 (quit) MayDaniel: Read error: Connection reset by peer 19:05 (quit) carleastlund: Quit: carleastlund 19:06 (join) masm 19:19 (join) mheld 19:21 (quit) mheld: Remote host closed the connection 19:22 (join) mheld 20:49 (quit) jonrafkind: Read error: Operation timed out 21:22 (quit) bremner_: Ping timeout: 272 seconds 21:25 (join) bremner 21:40 (quit) parcs: Ping timeout: 255 seconds 21:41 (join) parcs 22:44 (join) corruptmemory 22:44 (quit) corruptmemory: Remote host closed the connection 22:51 (join) pattern 22:54 (join) corruptmemory 22:59 (quit) corruptmemory: Client Quit 22:59 (quit) masm: Quit: Leaving. 22:59 (join) corruptmemory 23:19 (join) offby1 23:45 (quit) offby1: Quit: Page closed 23:52 (join) offby1