2009 Nov 30 01:05:30 hey aamar 2009 Nov 30 01:06:08 hey inimino 2009 Nov 30 01:06:32 how's it going? 2009 Nov 30 01:06:59 how's it going? 2009 Nov 30 01:07:07 ha, good 2009 Nov 30 01:07:14 hehe, good :) 2009 Nov 30 01:09:20 been glad to get back to this 2009 Nov 30 01:09:29 ah :) 2009 Nov 30 01:09:57 yeah, you were traveling last week 2009 Nov 30 01:09:59 look forward to actually joining the daily problems too, but I've been busy during the week lately 2009 Nov 30 01:10:16 yes, that too! 2009 Nov 30 01:10:21 yeah, it's hard to make time 2009 Nov 30 01:10:38 I kind of tend to do it all on the weekend 2009 Nov 30 01:10:59 I find it's fun when I'm working on it, but hard to stop working on something else to do it 2009 Nov 30 01:12:09 definitely, benefits from working in reasonably big chunks (like many things) 2009 Nov 30 01:12:22 yeah 2009 Nov 30 01:12:40 I also find it quite hard to keep track of everything going on in this section we are in 2009 Nov 30 01:13:15 probably would benefit from doing it more consistently 2009 Nov 30 01:13:53 well, should we get started? 2009 Nov 30 01:15:44 yes, let's start back with 4.18 2009 Nov 30 01:16:03 http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L390-411 2009 Nov 30 01:16:19 ok 2009 Nov 30 01:17:26 http://inimino.org/~inimino/projects/2009/SICP/chap_4/4.18 2009 Nov 30 01:18:44 looks like the same idea 2009 Nov 30 01:21:04 ok 2009 Nov 30 01:21:06 agreed 2009 Nov 30 01:21:09 4.19 ? 2009 Nov 30 01:21:12 sure 2009 Nov 30 01:21:16 http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L412-421 2009 Nov 30 01:21:24 http://inimino.org/~inimino/projects/2009/SICP/chap_4/4.19 2009 Nov 30 01:23:35 you gave considerably more detail... 2009 Nov 30 01:24:03 seems like a similar idea though 2009 Nov 30 01:24:45 the 'defer additional processing' is the vague part, I suppose 2009 Nov 30 01:24:49 here might be one difference 2009 Nov 30 01:25:08 did you have something like a loop in mind? 2009 Nov 30 01:25:26 Not a loop 2009 Nov 30 01:25:45 I imagined that all "defines" would be deferred, then reordered, then executed 2009 Nov 30 01:25:59 Your version says that all variable lookups would be deferred 2009 Nov 30 01:26:37 I think it amounts to the same thing, except it isn't exactly clear how mine would be implemented. 2009 Nov 30 01:26:42 ah 2009 Nov 30 01:27:25 yeah, I think so 2009 Nov 30 01:29:06 ok, 4.20? 2009 Nov 30 01:29:51 sure 2009 Nov 30 01:30:05 http://inimino.org/~inimino/projects/2009/SICP/chap_4/4.20 2009 Nov 30 01:31:03 http://inimino.org/~inimino/projects/2009/SICP/chap_4/4.20.svg 2009 Nov 30 01:31:07 and that 2009 Nov 30 01:32:59 oh http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L422-466 2009 Nov 30 01:34:52 for a. I think yours implements what mine describes 2009 Nov 30 01:35:04 b. looks like the same idea also 2009 Nov 30 01:35:28 I found this one illuminating and a I think it took me a while 2009 Nov 30 01:37:54 yes, I think we have the same basic idea 2009 Nov 30 01:38:12 in your second diagram, the (letrec context) is really a (let context) right? 2009 Nov 30 01:38:29 whoops, yes 2009 Nov 30 01:39:03 found a minor error in my part a, but I think it doesn't change the core of it 2009 Nov 30 01:39:59 fixed 2009 Nov 30 01:41:08 the let-rec-assignment-var? 2009 Nov 30 01:41:17 yes 2009 Nov 30 01:41:26 4.21 ? 2009 Nov 30 01:41:31 ok 2009 Nov 30 01:41:51 http://inimino.org/~inimino/projects/2009/SICP/chap_4/4.21 2009 Nov 30 01:42:44 http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L469-507 2009 Nov 30 01:45:11 ok, interesting, yet straightforward 2009 Nov 30 01:45:44 yeah 2009 Nov 30 01:45:52 this was a fun one 2009 Nov 30 01:46:30 I agree 2009 Nov 30 01:46:55 looks like the same answers 2009 Nov 30 01:46:59 4.22? 2009 Nov 30 01:47:05 yes 2009 Nov 30 01:47:11 http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L509-519 2009 Nov 30 01:47:18 ah, I started this one but didn't finish 2009 Nov 30 01:47:37 I have a lot of those coming up :( 2009 Nov 30 01:48:16 me too 2009 Nov 30 01:48:18 heh 2009 Nov 30 01:48:21 http://inimino.org/~inimino/projects/2009/SICP/chap_4/my_ch4-analyzingmceval.scm 2009 Nov 30 01:48:27 what I have is at the bottom of that file 2009 Nov 30 01:48:42 with some debugging stuff I added, when that didn't work 2009 Nov 30 01:48:55 ...which didn't actually help me make sense of anything 2009 Nov 30 01:49:01 heh 2009 Nov 30 01:50:22 looks like we have similar ideas 2009 Nov 30 01:50:35 yes. seem to be the same 2009 Nov 30 01:50:38 I'm not sure why mine doesn't work 2009 Nov 30 01:50:40 but I didn't test mine at all! 2009 Nov 30 01:50:55 I did, but the results were disappointing 2009 Nov 30 01:51:29 (define (f x) (let ((y x)) (cons y y))) 2009 Nov 30 01:51:34 something like that was my test 2009 Nov 30 01:51:52 then (f 'a) 2009 Nov 30 01:52:08 gives an error 'undefined variable y' or some such 2009 Nov 30 01:52:50 I tried to follow what was going on but got confused and gave up 2009 Nov 30 01:52:59 I may come back to this one 2009 Nov 30 01:53:15 same here 2009 Nov 30 01:53:19 ok 2009 Nov 30 01:53:37 4.23? 2009 Nov 30 01:53:42 4.23 ? 2009 Nov 30 01:53:52 k 2009 Nov 30 01:54:02 http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L521-529 2009 Nov 30 01:55:02 http://inimino.org/~inimino/projects/2009/SICP/chap_4/4.23 2009 Nov 30 01:55:45 same answer, I think 2009 Nov 30 01:56:16 yes 2009 Nov 30 01:56:25 ha 2009 Nov 30 01:56:47 looks like we've both skipped 4.24 2009 Nov 30 01:56:54 hehe yes 2009 Nov 30 01:56:58 good taste 2009 Nov 30 01:57:13 Even with all the code from the book, I didn't completely get the meta-circular evaluator working reliably 2009 Nov 30 01:57:38 yeah I only did a few things with it 2009 Nov 30 01:57:49 and I couldn't get excited about doing that just for this exercise... 2009 Nov 30 01:57:55 I find it kind of inconvenient to run things in MIT/GNU scheme 2009 Nov 30 01:58:04 the REPL sucks IMO 2009 Nov 30 01:58:41 maybe there's a way to get it to use readline, but it doesn't by default 2009 Nov 30 01:58:52 speaking of repl, how do i get pretty printing in mzscheme? 2009 Nov 30 01:59:07 so running anything is a laborious process of retyping things, or cutting and pasting... 2009 Nov 30 01:59:28 -*- inimino hasn't used MZScheme 2009 Nov 30 01:59:56 and the mc-eval seems to faithfully duplicate all these faults 2009 Nov 30 02:00:04 I guess I could try rlwrap 2009 Nov 30 02:00:42 I've been running in emacs, where C-x C-e evaluates the last expression 2009 Nov 30 02:01:04 ah... that's probably the right way to do it 2009 Nov 30 02:01:26 Actually tried a number of things earlier on, since it's been years since I used emacs heavily 2009 Nov 30 02:01:51 yeah I use emacs when I need to deal with some pathologically verbose language like Java or XML 2009 Nov 30 02:01:55 (I hated customizing it, then losing all my customizations whenever I logged onto a different machine -- switched to vi as a result, which is better by "default") 2009 Nov 30 02:01:57 but that's rare these days 2009 Nov 30 02:02:12 But I had the same annoyances with cutting and pasting. 2009 Nov 30 02:02:19 And this seems to handle it. 2009 Nov 30 02:02:36 I'll try it 2009 Nov 30 02:03:11 I also use vi because I like the keybindings 2009 Nov 30 02:04:00 well, 4.25? 2009 Nov 30 02:04:46 yes 2009 Nov 30 02:04:59 http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L533-538 2009 Nov 30 02:05:24 ok, same answer 2009 Nov 30 02:05:30 ok 4.26 ? 2009 Nov 30 02:05:45 yeah 2009 Nov 30 02:05:56 http://inimino.org/~inimino/projects/2009/SICP/chap_4/4.26 2009 Nov 30 02:06:38 http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L540-553 2009 Nov 30 02:07:26 looks like we came up with a similar example, too 2009 Nov 30 02:07:32 yes 2009 Nov 30 02:07:44 your last part is interesting 2009 Nov 30 02:08:22 do you mean: (stream-map (lambda (a b c) (unless a b c)) x y z) ? 2009 Nov 30 02:08:33 i.e. you're passing in 3 streams, right? 2009 Nov 30 02:08:40 ah, yes I did 2009 Nov 30 02:08:52 I forgot to pass in the streams 2009 Nov 30 02:09:32 oh, and it does more work, because it essentially will evaluate elements of y & z it didn't need to 2009 Nov 30 02:09:34 interesting 2009 Nov 30 02:09:38 great example 2009 Nov 30 02:09:39 ok 2009 Nov 30 02:10:36 http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L555-565 2009 Nov 30 02:11:09 http://inimino.org/~inimino/projects/2009/SICP/chap_4/4.27 2009 Nov 30 02:12:14 okay, different at the end 2009 Nov 30 02:12:19 oh, hm 2009 Nov 30 02:13:28 id is called twice, and set! is called twice, isn't it? 2009 Nov 30 02:14:24 so, I think the first time the inner id is called, the set! gets called 2009 Nov 30 02:14:46 the memoization only applies to a specific call, so even though the argument id sees is 10 each time, there are two separate id calls 2009 Nov 30 02:14:49 but I _think_ when the second id is called, it returns the memoized result instead of actually calling the function again 2009 Nov 30 02:15:03 I think it calls it again 2009 Nov 30 02:15:42 I see 2009 Nov 30 02:15:57 each (id _) creates its own thunk 2009 Nov 30 02:16:19 both of them have to be forced 2009 Nov 30 02:16:28 I see 2009 Nov 30 02:16:34 Ok, yeah, I agree 2009 Nov 30 02:16:41 but then no matter how many times w is used, it will stay at 2 2009 Nov 30 02:16:43 ok 2009 Nov 30 02:17:02 among other things, they have a different env, so of course they have different thunks 2009 Nov 30 02:17:27 ah, true 2009 Nov 30 02:18:10 I sort of hoped that after working through this chapter I'd have a crystal clear concept of what the evaluator would do with all these expressions, but I still find my understanding is quite a bit muddy 2009 Nov 30 02:18:49 I guess it just takes time 2009 Nov 30 02:19:32 That's my hope 2009 Nov 30 02:19:51 The exercises do help a lot -- wouldn't have minded more in some of these sections 2009 Nov 30 02:19:59 agreed 2009 Nov 30 02:21:13 when the other group gets to this point, it'll probably help to go back and rework some of them 2009 Nov 30 02:21:36 good idea 2009 Nov 30 02:22:01 there are actually a fair number that we skipped in ch.2 that would be helpful as well 2009 Nov 30 02:22:24 I found just reviewing some of the earlier ones and explaining a couple things helped clarify things that I may have skimmed over before 2009 Nov 30 02:22:31 yeah 2009 Nov 30 02:24:35 pushed up a couple more exercises 2009 Nov 30 02:24:50 (you might have to refresh if you were just scrolling down) 2009 Nov 30 02:25:03 4.28 ? 2009 Nov 30 02:25:04 http://github.com/aalearn/aalearn-sicp/blob/master/ch4-outline.scm#L568-573 2009 Nov 30 02:25:17 ok 2009 Nov 30 02:25:19 http://inimino.org/~inimino/projects/2009/SICP/chap_4/4.28 2009 Nov 30 02:25:42 Ok, different examples. 2009 Nov 30 02:25:54 I'm fairly certain yours qualifies... do you think mine works as an example? 2009 Nov 30 02:27:06 I think so, though it's possible cadr would be treated as a primitive procedure and the same rules might not apply 2009 Nov 30 02:27:24 I'm not sure about that, but I think the idea is right in any case 2009 Nov 30 02:27:36 ok 2009 Nov 30 02:28:59 ah, my 4.29 is definitely wrong 2009 Nov 30 02:29:13 yeah I started out with a fib example just like that 2009 Nov 30 02:29:19 because I made the same mistake with not understanding what memoization was doing in this case 2009 Nov 30 02:29:24 but yeah 2009 Nov 30 02:29:37 and 4.29 is the last one I finished 2009 Nov 30 02:29:51 4.30 seems hard 2009 Nov 30 02:31:26 ok, where to next time? 2009 Nov 30 02:31:34 -*- inimino looks ahead 2009 Nov 30 02:32:43 4.49? 2009 Nov 30 02:33:39 ok 2009 Nov 30 02:33:45 I think all of 4.3 would probably be too much, that would be 4.54 2009 Nov 30 02:33:54 yes, looks good! 2009 Nov 30 02:34:44 alright, cool 2009 Nov 30 02:36:03 see you then! 2009 Nov 30 02:36:30 see you