2014-10-20T00:05:36Z tadni quit (Ping timeout: 246 seconds) 2014-10-20T00:13:28Z tadni joined #scheme 2014-10-20T00:15:36Z byte48 joined #scheme 2014-10-20T00:15:46Z ilammy quit (Ping timeout: 246 seconds) 2014-10-20T00:28:06Z masm quit (Ping timeout: 255 seconds) 2014-10-20T00:28:40Z Shadox joined #scheme 2014-10-20T00:29:03Z tadni quit (Ping timeout: 272 seconds) 2014-10-20T00:32:27Z githogori quit (Read error: Connection reset by peer) 2014-10-20T00:41:48Z vanila quit (Quit: Leaving) 2014-10-20T00:41:58Z tadni joined #scheme 2014-10-20T00:43:12Z Rodya_ joined #scheme 2014-10-20T00:51:02Z mejja joined #scheme 2014-10-20T00:54:17Z republican_devil: The whole using scheme as a db itself is kinda cool to me. 2014-10-20T00:54:28Z republican_devil: like www.prevayler.org but in a non jvm 2014-10-20T00:54:33Z republican_devil: java and oracle must die 2014-10-20T00:54:59Z tadni: republican_devil: Good luck with that. 2014-10-20T00:56:02Z republican_devil: I think someone did port www.prevayler.org to scheme but then its lost 2014-10-20T00:56:04Z republican_devil: bugger 2014-10-20T00:56:28Z republican_devil: I dont even like oo programming, so a functional say list or set based prevayler would be nice 2014-10-20T00:56:38Z republican_devil: esp if the logic could place blobs and text gobs on disk 2014-10-20T00:56:53Z republican_devil: and keep just the calculation of html and sets in ram 2014-10-20T00:57:16Z republican_devil: with scheme there is not too much difference between what we can do and what we can imagine 2014-10-20T00:57:20Z republican_devil: YEAH!!!! 2014-10-20T01:07:56Z mrowe is now known as mrowe_away 2014-10-20T01:10:15Z kongtomorrow quit 2014-10-20T01:14:00Z zacts: not gavino again 2014-10-20T01:14:10Z zacts ignores gavino 2014-10-20T01:15:24Z jusss joined #scheme 2014-10-20T01:18:40Z republican_devil: thinks zacts should get educated 2014-10-20T01:19:55Z kilimanjaro: me first plz 2014-10-20T01:24:24Z tobik quit (Ping timeout: 245 seconds) 2014-10-20T01:25:42Z tadni quit (Ping timeout: 255 seconds) 2014-10-20T01:25:54Z tobik joined #scheme 2014-10-20T01:26:44Z tadni joined #scheme 2014-10-20T01:29:05Z republican_devil: educated people vote republican 2014-10-20T01:29:16Z republican_devil: there is no such thing as global warming 2014-10-20T01:31:26Z tadni: republican_devil: Yeah, warming should really be a local variable. 2014-10-20T01:32:26Z republican_devil: ice is thicker 2014-10-20T01:32:30Z republican_devil: 18 years cooling 2014-10-20T01:32:32Z republican_devil: well 2014-10-20T01:32:51Z republican_devil: science means truth 2014-10-20T01:32:58Z republican_devil: you can't assume global warming 2014-10-20T01:33:03Z Shadox quit (Quit: Leaving) 2014-10-20T01:33:12Z republican_devil: academics needs to go get real jobs 2014-10-20T01:33:16Z republican_devil: stop working welfare jobs 2014-10-20T01:33:57Z tadni: republican_devil: Assuming you're not trolling and disregarding this is not place to talk about this, global "warming" is a misnomer. The correct term is "climate change" -- which is marked by extreme changes on both ends. 2014-10-20T01:38:26Z tadni quit (Ping timeout: 240 seconds) 2014-10-20T01:46:16Z republican_devil: bah 2014-10-20T01:48:41Z republican_devil: dont tell me I'm wrong AND to be quiet you uneducated commy 2014-10-20T01:49:05Z republican_devil: and practice what u preech if u want no political talk 2014-10-20T01:49:14Z cjh`_: ... 2014-10-20T01:58:28Z republican_devil: yeah 2014-10-20T02:00:05Z tadni joined #scheme 2014-10-20T02:21:06Z amgarchIn9 quit (Ping timeout: 240 seconds) 2014-10-20T02:23:12Z zacts: tadni: I think republican_devil is a classic nick for gavino 2014-10-20T02:23:17Z zacts: and gavino is a troll 2014-10-20T02:27:50Z mrowe_away is now known as mrowe 2014-10-20T02:28:59Z ehaliewicz joined #scheme 2014-10-20T02:29:27Z jeapostrophe quit (Ping timeout: 245 seconds) 2014-10-20T02:33:17Z ehaliewicz quit (Remote host closed the connection) 2014-10-20T02:41:47Z Niac joined #scheme 2014-10-20T02:51:06Z ric_chopin joined #scheme 2014-10-20T02:53:37Z republican_devil: zacts is a troll 2014-10-20T02:53:44Z republican_devil: and uneducated 2014-10-20T02:56:13Z b4283 joined #scheme 2014-10-20T02:59:18Z araujo quit (Quit: Leaving) 2014-10-20T03:00:02Z republican_devil: ignore him 2014-10-20T03:08:44Z kongtomorrow joined #scheme 2014-10-20T03:10:55Z Linkrules joined #scheme 2014-10-20T03:12:01Z ric_chopin quit (Ping timeout: 260 seconds) 2014-10-20T03:12:18Z kongtomorrow quit (Remote host closed the connection) 2014-10-20T03:12:56Z kongtomorrow joined #scheme 2014-10-20T03:20:48Z kongtomorrow quit 2014-10-20T03:30:24Z Linkrules_ joined #scheme 2014-10-20T03:33:45Z jusss quit (Quit: ERC Version 5.2 (IRC client for Emacs)) 2014-10-20T03:34:31Z Linkrules quit (Ping timeout: 272 seconds) 2014-10-20T03:35:23Z b4283 quit (Ping timeout: 258 seconds) 2014-10-20T03:37:21Z kongtomorrow joined #scheme 2014-10-20T03:37:25Z davexunit quit (Quit: Later) 2014-10-20T03:38:34Z Rodya_ quit (Quit: Ex-Chat) 2014-10-20T03:40:46Z mejja quit (Quit: ChatZilla 0.9.91 [Firefox 33.0/20141011015303]) 2014-10-20T03:43:31Z republican_devil left #scheme 2014-10-20T03:54:21Z leppie quit 2014-10-20T03:57:21Z leppie joined #scheme 2014-10-20T04:15:37Z oleo is now known as Guest78623 2014-10-20T04:17:13Z oleo__ joined #scheme 2014-10-20T04:18:16Z Guest78623 quit (Ping timeout: 250 seconds) 2014-10-20T04:32:19Z daviid quit (Ping timeout: 245 seconds) 2014-10-20T04:50:05Z jhao quit (Ping timeout: 260 seconds) 2014-10-20T04:58:10Z vukcrni quit (Remote host closed the connection) 2014-10-20T05:00:20Z vukcrni joined #scheme 2014-10-20T05:09:38Z Linkrules_ quit (Quit: Leaving) 2014-10-20T05:12:04Z bevan joined #scheme 2014-10-20T05:29:41Z frkout_ joined #scheme 2014-10-20T05:31:16Z frkout_ quit (Read error: Connection reset by peer) 2014-10-20T05:31:37Z frkout_ joined #scheme 2014-10-20T05:33:07Z frkout quit (Ping timeout: 255 seconds) 2014-10-20T05:34:59Z kongtomorrow quit 2014-10-20T05:36:58Z mrowe is now known as mrowe_away 2014-10-20T05:37:47Z kongtomorrow joined #scheme 2014-10-20T05:46:26Z jhao joined #scheme 2014-10-20T05:51:19Z oleo__ quit (Quit: Verlassend) 2014-10-20T05:52:39Z kongtomorrow quit 2014-10-20T05:54:04Z kongtomorrow joined #scheme 2014-10-20T05:58:35Z b4283 joined #scheme 2014-10-20T06:00:53Z tobik quit (Quit: ZNC - http://znc.in) 2014-10-20T06:02:33Z kongtomorrow quit 2014-10-20T06:05:47Z kongtomorrow joined #scheme 2014-10-20T06:10:33Z c107 quit (Remote host closed the connection) 2014-10-20T06:11:49Z jhao quit (Ping timeout: 255 seconds) 2014-10-20T06:16:24Z germ13 joined #scheme 2014-10-20T06:16:49Z Vutral__ joined #scheme 2014-10-20T06:17:32Z Vutral_ quit (Ping timeout: 258 seconds) 2014-10-20T06:19:22Z cataska quit (Read error: Connection reset by peer) 2014-10-20T06:31:36Z frkout_ quit (Remote host closed the connection) 2014-10-20T06:32:02Z frkout joined #scheme 2014-10-20T06:39:27Z cataska joined #scheme 2014-10-20T06:50:07Z tobik joined #scheme 2014-10-20T06:53:03Z wingo joined #scheme 2014-10-20T07:00:02Z frkout_ joined #scheme 2014-10-20T07:03:17Z frkout quit (Ping timeout: 244 seconds) 2014-10-20T07:03:30Z bevan quit (Quit: Leaving) 2014-10-20T07:05:34Z taylanub: maybe we could give +o to a couple (more) people here. should work fine if gavino is not the type of troll who puts in a lot of effort to ban-evade in the short term. 2014-10-20T07:07:14Z taylanub: tadni: well, the average temperature of the globe is increasing, so it's OK to call it global warming. however, this makes some less than smart people expect to see noticable warming everywhere at all times, when in fact some places can get colder indeed. 2014-10-20T07:08:36Z gravicappa joined #scheme 2014-10-20T07:21:49Z cr`nge joined #scheme 2014-10-20T07:26:10Z stepnem joined #scheme 2014-10-20T07:27:46Z masm joined #scheme 2014-10-20T07:30:46Z psy quit (Ping timeout: 240 seconds) 2014-10-20T07:32:25Z psy joined #scheme 2014-10-20T07:44:00Z pnkfelix joined #scheme 2014-10-20T07:44:11Z kongtomorrow quit 2014-10-20T07:44:27Z robot-beethoven joined #scheme 2014-10-20T07:54:29Z hiroakip joined #scheme 2014-10-20T07:54:55Z jhao joined #scheme 2014-10-20T07:59:07Z frkout_ quit (Remote host closed the connection) 2014-10-20T07:59:33Z frkout joined #scheme 2014-10-20T07:59:36Z jhao quit (Ping timeout: 244 seconds) 2014-10-20T08:05:11Z renopt quit (Remote host closed the connection) 2014-10-20T08:09:23Z lrs joined #scheme 2014-10-20T08:12:20Z kongtomorrow joined #scheme 2014-10-20T08:17:11Z kongtomorrow quit (Ping timeout: 265 seconds) 2014-10-20T08:31:45Z mrowe_away is now known as mrowe 2014-10-20T08:49:01Z DGASAU joined #scheme 2014-10-20T08:49:39Z cr`nge_ joined #scheme 2014-10-20T08:50:05Z mrowe is now known as mrowe_away 2014-10-20T08:50:39Z cr`nge_ quit (Read error: Connection reset by peer) 2014-10-20T09:01:07Z bobbybro` joined #scheme 2014-10-20T09:03:50Z bobbybrown quit (Ping timeout: 250 seconds) 2014-10-20T09:16:05Z mrowe_away is now known as mrowe 2014-10-20T09:17:44Z DGASAU quit (Ping timeout: 245 seconds) 2014-10-20T09:18:55Z DGASAU joined #scheme 2014-10-20T09:26:55Z germ13 quit (Ping timeout: 244 seconds) 2014-10-20T09:29:43Z robot-beethoven quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-20T09:38:45Z Niac quit (Remote host closed the connection) 2014-10-20T09:40:25Z gravicappa quit (Remote host closed the connection) 2014-10-20T09:43:23Z jhao joined #scheme 2014-10-20T09:48:32Z jhao quit (Ping timeout: 265 seconds) 2014-10-20T09:52:18Z tadni quit (Read error: Connection reset by peer) 2014-10-20T09:53:07Z tadni joined #scheme 2014-10-20T10:10:46Z BossKonaSegwaY quit (Ping timeout: 265 seconds) 2014-10-20T10:24:42Z BossKonaSegwaY joined #scheme 2014-10-20T10:25:57Z jeapostrophe joined #scheme 2014-10-20T10:25:57Z jeapostrophe quit (Changing host) 2014-10-20T10:25:57Z jeapostrophe joined #scheme 2014-10-20T10:40:02Z BossKonaSegwaY quit (Ping timeout: 250 seconds) 2014-10-20T10:41:50Z pnkfelix quit (Ping timeout: 244 seconds) 2014-10-20T10:44:27Z jewel_ quit (Ping timeout: 245 seconds) 2014-10-20T10:51:56Z Vutral_ joined #scheme 2014-10-20T10:52:54Z Vutral__ quit (Ping timeout: 272 seconds) 2014-10-20T10:54:12Z mrowe is now known as mrowe_away 2014-10-20T10:54:18Z BossKonaSegwaY joined #scheme 2014-10-20T10:55:56Z matthewhill joined #scheme 2014-10-20T10:58:37Z gravicappa joined #scheme 2014-10-20T10:59:08Z matthewhill quit (Client Quit) 2014-10-20T11:04:57Z ivanshmakov quit (Remote host closed the connection) 2014-10-20T11:09:49Z ivanshmakov joined #scheme 2014-10-20T11:11:52Z ijp joined #scheme 2014-10-20T11:25:14Z tobik quit (Ping timeout: 245 seconds) 2014-10-20T11:26:06Z BossKonaSegwaY quit (Ping timeout: 240 seconds) 2014-10-20T11:26:30Z tobik joined #scheme 2014-10-20T11:32:07Z jhao joined #scheme 2014-10-20T11:37:10Z jhao quit (Ping timeout: 255 seconds) 2014-10-20T11:43:06Z BossKonaSegwaY joined #scheme 2014-10-20T11:48:47Z ijp quit (Quit: egg sandwiches) 2014-10-20T11:59:06Z matthewhill joined #scheme 2014-10-20T12:11:44Z arbscht quit (Ping timeout: 244 seconds) 2014-10-20T12:25:09Z jusss joined #scheme 2014-10-20T12:31:37Z matthewhill quit (Quit: Lingo: www.lingoirc.com) 2014-10-20T12:32:54Z jhao joined #scheme 2014-10-20T12:34:55Z jewel joined #scheme 2014-10-20T12:37:55Z jhao quit (Ping timeout: 272 seconds) 2014-10-20T12:45:57Z vanila joined #scheme 2014-10-20T12:46:07Z vinleod joined #scheme 2014-10-20T12:46:29Z jewel quit (Ping timeout: 245 seconds) 2014-10-20T13:02:40Z jewel joined #scheme 2014-10-20T13:03:13Z pnkfelix joined #scheme 2014-10-20T13:09:08Z arbscht joined #scheme 2014-10-20T13:10:39Z jusss: hi all 2014-10-20T13:10:47Z jusss: http://paste.ubuntu.com/8601680/ 2014-10-20T13:11:03Z davexunit joined #scheme 2014-10-20T13:11:15Z jusss: where it's wrong ? 2014-10-20T13:14:20Z Natch quit (Remote host closed the connection) 2014-10-20T13:16:54Z vinleod quit (Quit: ["Textual IRC Client: www.textualapp.com"]) 2014-10-20T13:23:23Z serhart: line 3 2014-10-20T13:29:37Z jusss: yes 2014-10-20T13:29:49Z jusss: (car '()) is wrong 2014-10-20T13:30:37Z serhart: yup 2014-10-20T13:32:11Z oleo joined #scheme 2014-10-20T13:36:49Z joneshf-laptop quit (Read error: Connection reset by peer) 2014-10-20T13:37:53Z Vutral quit (Ping timeout: 260 seconds) 2014-10-20T13:41:36Z joneshf-laptop joined #scheme 2014-10-20T13:42:37Z taylanub quit (Disconnected by services) 2014-10-20T13:43:08Z fgudin joined #scheme 2014-10-20T13:43:26Z taylanub joined #scheme 2014-10-20T13:43:55Z hiroakip quit (Ping timeout: 265 seconds) 2014-10-20T13:44:56Z Vutral joined #scheme 2014-10-20T13:49:49Z lrs quit (Ping timeout: 245 seconds) 2014-10-20T14:02:56Z gravicappa quit (Remote host closed the connection) 2014-10-20T14:09:58Z daviid joined #scheme 2014-10-20T14:11:01Z bobbybro` quit (Ping timeout: 260 seconds) 2014-10-20T14:14:21Z em quit (Ping timeout: 246 seconds) 2014-10-20T14:15:28Z przl joined #scheme 2014-10-20T14:21:35Z askatasuna joined #scheme 2014-10-20T14:21:35Z em joined #scheme 2014-10-20T14:21:37Z jhao joined #scheme 2014-10-20T14:24:53Z jusss quit (Read error: Connection reset by peer) 2014-10-20T14:25:05Z mutley89 quit (Ping timeout: 272 seconds) 2014-10-20T14:26:14Z em quit (Ping timeout: 250 seconds) 2014-10-20T14:26:40Z jhao quit (Ping timeout: 258 seconds) 2014-10-20T14:26:46Z psy quit (Remote host closed the connection) 2014-10-20T14:27:14Z em joined #scheme 2014-10-20T14:30:11Z jusss joined #scheme 2014-10-20T14:32:16Z em quit (Ping timeout: 244 seconds) 2014-10-20T14:35:10Z iterrogo joined #scheme 2014-10-20T14:40:14Z Riastradh joined #scheme 2014-10-20T14:41:01Z germ13 joined #scheme 2014-10-20T14:47:12Z mutley89 joined #scheme 2014-10-20T14:57:09Z Kruppe quit (Quit: ZNC - http://znc.in) 2014-10-20T14:58:33Z jusss quit (Quit: ERC Version 5.2 (IRC client for Emacs)) 2014-10-20T14:58:40Z Kruppe joined #scheme 2014-10-20T15:01:44Z em joined #scheme 2014-10-20T15:05:50Z araujo joined #scheme 2014-10-20T15:05:50Z araujo quit (Changing host) 2014-10-20T15:05:50Z araujo joined #scheme 2014-10-20T15:07:01Z lrs joined #scheme 2014-10-20T15:21:33Z daviid quit (Ping timeout: 265 seconds) 2014-10-20T15:22:56Z Natch joined #scheme 2014-10-20T15:34:45Z theseb joined #scheme 2014-10-20T15:46:32Z jeremyhe_ joined #scheme 2014-10-20T15:49:48Z jeremyh__ joined #scheme 2014-10-20T15:50:18Z przl quit (Ping timeout: 250 seconds) 2014-10-20T15:51:32Z jeremyhe_ quit (Ping timeout: 245 seconds) 2014-10-20T15:52:23Z jhao joined #scheme 2014-10-20T15:56:06Z phipes joined #scheme 2014-10-20T15:56:17Z phipes quit (Max SendQ exceeded) 2014-10-20T15:56:57Z jhao quit (Ping timeout: 245 seconds) 2014-10-20T16:15:29Z lrs: Im trying to find info about arrays in cheme 2014-10-20T16:15:31Z lrs: scheme 2014-10-20T16:15:34Z lrs: Anyone have any tips? 2014-10-20T16:17:06Z przl joined #scheme 2014-10-20T16:17:27Z sethalves: have you read about vectors? 2014-10-20T16:17:55Z lrs: Ive read the part in SICP 2014-10-20T16:18:10Z przl quit (Client Quit) 2014-10-20T16:18:14Z LeoNerd: "arrays"? Perhaps you mean vectors? 2014-10-20T16:18:25Z lrs: Yes 2014-10-20T16:20:26Z gravicappa joined #scheme 2014-10-20T16:20:57Z lrs: I have a function 2014-10-20T16:20:57Z lrs: (define (minim lst) 2014-10-20T16:20:57Z lrs: (cond ((null? (cdr lst)) (car lst)) 2014-10-20T16:20:57Z lrs: ((< (car lst) (minim (cdr lst))) 2014-10-20T16:20:57Z lrs: (car lst)) 2014-10-20T16:20:57Z lrs: (else (minim (cdr lst))))) 2014-10-20T16:21:02Z lrs: For finding the min of a lst 2014-10-20T16:21:07Z lrs: But vectors is different ;_; 2014-10-20T16:21:17Z gnomon quit (Ping timeout: 258 seconds) 2014-10-20T16:21:56Z LeoNerd: Surely the minimal value of a vector is just a fold? 2014-10-20T16:22:22Z lrs: What is a fold? 2014-10-20T16:22:29Z LeoNerd: (vector-reduce min2 v) for some function min2 that returns the minimal of 2 elements 2014-10-20T16:22:45Z lrs: LeoNerd, I need to learn how to do this 2014-10-20T16:22:59Z lrs: basically, do the simplest but also the most educational way to do this 2014-10-20T16:28:12Z vanila: to find the minimum of #(2 5 4 7 6 3 1 5) 2014-10-20T16:28:17Z lrs: Yes 2014-10-20T16:28:22Z vanila: you can start with the guess 2 (the first cell) 2014-10-20T16:28:34Z vanila: and then check (< 5 2) ;=> #f 2014-10-20T16:28:37Z vanila: so continue with 2 2014-10-20T16:28:38Z vanila: and so on 2014-10-20T16:28:40Z gnomon joined #scheme 2014-10-20T16:28:45Z MichaelRaskin joined #scheme 2014-10-20T16:28:47Z vanila: until you reach (< 1 2) ;=> #t 2014-10-20T16:28:53Z vanila: so you improve the guess to 1 2014-10-20T16:29:28Z vanila: (define (minimum-loop guess index vector vector-length) ...) 2014-10-20T16:29:40Z LeoNerd: I still prefer vector-reduce 2014-10-20T16:29:41Z vanila: you can write a loop like this, it should return guess once it reaches the end 2014-10-20T16:29:51Z vanila: okay maybe vector-reduce is better, I didnt know about it 2014-10-20T16:30:22Z LeoNerd: I just invented it but hopefully the concept should be clear enough 2014-10-20T16:31:22Z LeoNerd: (vector-reduce f v) === (reduce f (vector->list v)) except likely more efficient to implement 2014-10-20T16:37:19Z lrs: LeoNerd, What does vector-reduce do? 2014-10-20T16:37:25Z lrs: Reduces vectors? 2014-10-20T16:37:43Z LeoNerd: Surely obvious by analogy to 'reduce' and also by the equivalence I just wrote :) 2014-10-20T16:41:22Z jeremyh__ quit (Quit: Textual IRC Client: www.textualapp.com) 2014-10-20T16:41:48Z lrs: LeoNerd, vector->list I dont get that though 2014-10-20T16:42:04Z LeoNerd: Surely (vector->list #(1 2 3 4)) === '(1 2 3 4) 2014-10-20T16:42:10Z LeoNerd: convert a vector to a list 2014-10-20T16:42:28Z lrs: How do you do that? :| 2014-10-20T16:42:37Z LeoNerd: ... *sigh* 2014-10-20T16:42:41Z LeoNerd: did you ever play with Lego as a child? 2014-10-20T16:42:57Z lrs: Alot 2014-10-20T16:43:16Z LeoNerd: Lego is by far the /most useful/ toy ever to give to a child. It teaches the importance of the fact that big things can be built by combining the right set of smaller things in the right way 2014-10-20T16:43:46Z LeoNerd: So.. how do you convert a vector to a list? I don't know off the top of my head but the moment I think about it I can think of at least two ways 2014-10-20T16:44:16Z LeoNerd: A hint on one way: consider the list (0 1 2 .... $n-1) where $n is the length of the vector 2014-10-20T16:45:08Z LeoNerd: Another would be the accumulator-helper loop 2014-10-20T16:45:32Z LeoNerd: but that way isn't alllll that efficient unless you either a: build the return list in reverse, or b: have TCMC in your implementation 2014-10-20T16:46:24Z jeremyhe_ joined #scheme 2014-10-20T16:47:54Z LeoNerd: Anyway, the vector primitives you get to play with are (vector-length v) and (vector-ref v idx); go see what you can come up with 2014-10-20T16:48:36Z lrs: LeoNerd, Did you see the code i pasted before? 2014-10-20T16:49:55Z LeoNerd: Nope 2014-10-20T16:50:15Z lrs: Oh wait i didnt post it 2014-10-20T16:50:23Z LeoNerd: ;) 2014-10-20T16:50:24Z lrs: (define f v) 2014-10-20T16:50:24Z lrs: (define (inner n minsta) 2014-10-20T16:50:24Z lrs: (if (= n (vector-length v)) 2014-10-20T16:50:25Z lrs: #f 2014-10-20T16:50:25Z lrs: (if (= (vector-ref v n ) 3) 2014-10-20T16:50:25Z lrs: n 2014-10-20T16:50:27Z lrs: (inner (+ n 1))))) 2014-10-20T16:50:31Z LeoNerd: Please don't paste code. 2014-10-20T16:50:38Z lrs: Ok wait 2014-10-20T16:50:46Z jeremyhe_ quit (Client Quit) 2014-10-20T16:51:14Z lrs: http://pastebin.com/Drsmn29U 2014-10-20T16:51:39Z jeremyhe_ joined #scheme 2014-10-20T16:51:47Z lrs: I pasted the wrong too 2014-10-20T16:51:59Z LeoNerd: Reasonable; though I'd adjust it a bit. For instance that #f is useless 2014-10-20T16:52:23Z lrs: Im having trouble understanding it 2014-10-20T16:52:25Z pnkfelix quit (Ping timeout: 265 seconds) 2014-10-20T16:52:32Z lrs: Also I need to add min to it riht 2014-10-20T16:52:36Z LeoNerd: Also I almost always find I have so many (+ n 1) things around that I define (inc n) instead 2014-10-20T16:53:53Z Vutral quit (Ping timeout: 260 seconds) 2014-10-20T16:56:00Z jeremyhe_ quit (Client Quit) 2014-10-20T17:00:06Z Vutral joined #scheme 2014-10-20T17:02:49Z pjb: lrs: all the info about scheme arrays are in the r5rs which is only 50 pages to read! 2014-10-20T17:03:04Z lrs: Why not r6rs 2014-10-20T17:04:16Z LeoNerd: Because R6RS is like the other Matrix films - It Doesn't Exist. 2014-10-20T17:04:40Z LeoNerd: The sequence goes: RS, RRS, R2RS, R3RS, R4RS, R5RS, R7RS-tiny 2014-10-20T17:04:54Z LeoNerd: I admit the spelling is a little off at the end there ;) 2014-10-20T17:05:05Z Vutral quit (Excess Flood) 2014-10-20T17:05:25Z lrs: http://www.r6rs.org/ 2014-10-20T17:05:29Z lrs: Then what is this? 2014-10-20T17:05:31Z lrs: :| 2014-10-20T17:05:41Z LeoNerd: Lies. And Deceipt 2014-10-20T17:05:51Z LeoNerd: And possibly subtle trickery of the worst kind 2014-10-20T17:06:25Z lrs burns the pagan books on the stake 2014-10-20T17:06:29Z vanila: lrs, R6RS is very controversial - some people love it and some people hate it 2014-10-20T17:06:47Z vanila: I think that it doesn't fit in the spirit of scheme at all and caused some damage fragmenting the community 2014-10-20T17:10:13Z oleo__ joined #scheme 2014-10-20T17:10:13Z oleo is now known as Guest5008 2014-10-20T17:10:53Z Guest5008 quit (Ping timeout: 240 seconds) 2014-10-20T17:10:53Z oleo__ quit (Read error: Connection reset by peer) 2014-10-20T17:11:57Z oleo__ joined #scheme 2014-10-20T17:12:12Z oleo__ is now known as oleo 2014-10-20T17:12:52Z Vutral joined #scheme 2014-10-20T17:19:33Z jeremyhe_ joined #scheme 2014-10-20T17:20:12Z jeremyhe_ left #scheme 2014-10-20T17:20:19Z hiroakip joined #scheme 2014-10-20T17:22:14Z amgarchIn9 joined #scheme 2014-10-20T17:23:08Z jhao joined #scheme 2014-10-20T17:25:37Z sheilong joined #scheme 2014-10-20T17:27:56Z jhao quit (Ping timeout: 244 seconds) 2014-10-20T17:31:03Z theseb quit (Ping timeout: 258 seconds) 2014-10-20T17:36:37Z b4283 quit (Quit: Konversation terminated!) 2014-10-20T17:40:45Z tadni quit (Read error: No route to host) 2014-10-20T17:45:01Z tadni joined #scheme 2014-10-20T17:59:40Z theseb joined #scheme 2014-10-20T18:15:05Z necronian quit (Ping timeout: 260 seconds) 2014-10-20T18:17:51Z necronian joined #scheme 2014-10-20T18:31:42Z wingo quit (Ping timeout: 255 seconds) 2014-10-20T18:41:37Z phipes joined #scheme 2014-10-20T18:43:59Z wingo joined #scheme 2014-10-20T18:58:42Z zacts quit (Read error: Connection reset by peer) 2014-10-20T18:59:00Z fikusz joined #scheme 2014-10-20T18:59:40Z joneshf-laptop quit (Read error: Connection reset by peer) 2014-10-20T18:59:51Z joneshf-laptop joined #scheme 2014-10-20T19:04:14Z zacts joined #scheme 2014-10-20T19:09:11Z zacts quit (Ping timeout: 258 seconds) 2014-10-20T19:10:07Z zacts joined #scheme 2014-10-20T19:11:47Z bb010g joined #scheme 2014-10-20T19:11:53Z jhao joined #scheme 2014-10-20T19:14:54Z zacts quit (Ping timeout: 255 seconds) 2014-10-20T19:15:58Z zacts joined #scheme 2014-10-20T19:16:15Z zacts quit (Client Quit) 2014-10-20T19:17:03Z jhao quit (Ping timeout: 272 seconds) 2014-10-20T19:19:20Z phipes quit (Quit: My MacBook has gone to sleep. ZZZzzz…) 2014-10-20T19:36:16Z fridim_ joined #scheme 2014-10-20T19:50:29Z zacts joined #scheme 2014-10-20T19:57:08Z rtra joined #scheme 2014-10-20T20:01:29Z hiroakip quit (Ping timeout: 260 seconds) 2014-10-20T20:03:46Z hiroakip joined #scheme 2014-10-20T20:12:38Z jhao joined #scheme 2014-10-20T20:17:27Z jhao quit (Ping timeout: 255 seconds) 2014-10-20T20:19:15Z joneshf-laptop quit (Remote host closed the connection) 2014-10-20T20:21:05Z Vutral quit (Ping timeout: 260 seconds) 2014-10-20T20:25:33Z Shadox joined #scheme 2014-10-20T20:30:11Z ijp joined #scheme 2014-10-20T20:32:19Z Vutral joined #scheme 2014-10-20T20:46:33Z sheilong quit (Quit: Konversation terminated!) 2014-10-20T20:48:42Z masm quit (Quit: Leaving.) 2014-10-20T20:58:36Z davexunit quit (Quit: Later) 2014-10-20T20:58:50Z mrowe_away is now known as mrowe 2014-10-20T21:13:27Z taylanub quit (Ping timeout: 272 seconds) 2014-10-20T21:14:00Z askatasuna quit (Ping timeout: 246 seconds) 2014-10-20T21:14:45Z wingo quit (Ping timeout: 244 seconds) 2014-10-20T21:20:57Z Vutral_ quit (Ping timeout: 244 seconds) 2014-10-20T21:23:40Z taylanub joined #scheme 2014-10-20T21:24:04Z theseb quit (Quit: Leaving) 2014-10-20T21:24:56Z gravicappa quit (Remote host closed the connection) 2014-10-20T21:32:29Z Vutral quit (Ping timeout: 260 seconds) 2014-10-20T21:38:41Z davexunit joined #scheme 2014-10-20T21:41:57Z BossKonaSegwaY quit (Ping timeout: 272 seconds) 2014-10-20T21:42:17Z Vutral joined #scheme 2014-10-20T21:48:58Z mornfall quit (Quit: ZNC - http://znc.sourceforge.net) 2014-10-20T21:49:31Z BossKonaSegwaY joined #scheme 2014-10-20T21:52:38Z iterrogo quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-20T21:57:19Z mrowe is now known as mrowe_away 2014-10-20T21:57:20Z bjz quit (Ping timeout: 250 seconds) 2014-10-20T22:00:03Z brianmwaters joined #scheme 2014-10-20T22:00:18Z brianmwaters quit (Client Quit) 2014-10-20T22:01:24Z jhao joined #scheme 2014-10-20T22:06:16Z jhao quit (Ping timeout: 255 seconds) 2014-10-20T22:14:51Z Sgeo quit (Read error: Connection reset by peer) 2014-10-20T22:14:51Z taylanub quit (Read error: Connection reset by peer) 2014-10-20T22:16:05Z taylanub joined #scheme 2014-10-20T22:16:21Z Sgeo joined #scheme 2014-10-20T22:19:48Z hiroakip quit (Ping timeout: 246 seconds) 2014-10-20T22:20:29Z Natch quit (Ping timeout: 260 seconds) 2014-10-20T22:20:39Z lrs quit (Ping timeout: 245 seconds) 2014-10-20T22:23:35Z jffmcc joined #scheme 2014-10-20T22:24:01Z jffmcc: Hi please point out the error: http://pastebin.com/MBRRRpq9 L is a list and a is an atom 2014-10-20T22:25:29Z vanila: jffmcc, (cdr '(1 2)) is (2) 2014-10-20T22:25:36Z vanila: you need to get th cadr rather than the cdr 2014-10-20T22:27:23Z jffmcc: i see thank you 2014-10-20T22:28:07Z jffmcc: cdr is a list, but cadr is an atom. Thanks so much! 2014-10-20T22:29:30Z vanila: glad to :) 2014-10-20T22:34:35Z jffmcc: Sorry, why am I getting #t, #t, #f, #f? It should be #t, #t, #t, #f. http://pastebin.com/QxFpMCqv 2014-10-20T22:38:28Z vanila: is because youre using IsInL2? still! your code is actually right 2014-10-20T22:38:56Z jffmcc: Lol *Facepalm* 2014-10-20T22:40:04Z jffmcc: Thanks again! 2014-10-20T22:41:10Z bb010g quit (Quit: Connection closed for inactivity) 2014-10-20T22:41:42Z askatasuna joined #scheme 2014-10-20T22:43:15Z lrs joined #scheme 2014-10-20T22:46:32Z DrJepordyMan joined #scheme 2014-10-20T22:46:41Z DrJepordyMan: I have this exercise: (define (my-map proc sequence) (accumulate (lambda (x y) ) '() sequence)) 2014-10-20T22:47:03Z DrJepordyMan: my question is where does lamabda get its x and y? 2014-10-20T22:47:15Z DrJepordyMan: does x = '() and y = sequence? 2014-10-20T22:47:29Z vanila: well lambda just creates a function 2014-10-20T22:47:56Z vanila: since you pass that function to accumulate, accumulate will be the thing that applies it to some parameters 2014-10-20T22:48:23Z vanila: Do you have the definition of accumulate? 2014-10-20T22:49:23Z fizzie: If it's the SICP "accumulate", y is the accumulated value (initially '(), then whatever you return) and x one element from the sequence for each iteration. But those could easily be the other way around. 2014-10-20T22:50:03Z DrJepordyMan: i do have the definition of accumulate from SICP 2014-10-20T22:50:20Z vanila: so lets look at that 2014-10-20T22:53:11Z DrJepordyMan: alright 2014-10-20T22:53:33Z DrJepordyMan: (define (accumulate op initial sequence) 2014-10-20T22:53:33Z DrJepordyMan: (if (null? sequence) 2014-10-20T22:53:33Z DrJepordyMan: initial 2014-10-20T22:53:33Z DrJepordyMan: (op (car sequence) 2014-10-20T22:53:33Z DrJepordyMan: (accumulate op initial (cdr sequence))))) 2014-10-20T22:53:36Z pjb: jffmcc: since you're working with lists (1 2), and not with pairs (1 . 2), you should probably (define first car) (define rest cdr) (define second cadr) … and use those list functional abstractions instead of using the abstraction leaking implementation functions car and cdr. 2014-10-20T22:55:13Z DrJepordyMan: why? 2014-10-20T22:55:39Z jffmcc: pjb, I already solved the question. Thanks. It would be easier for me to type car/cdr instead of defining. Less typing 2014-10-20T22:57:04Z DrJepordyMan: i stil don't understand how lambda is working in accumulate 2014-10-20T22:57:21Z DrJepordyMan: if you're passing a lambda function to the accumulate function in SICP 2014-10-20T22:59:07Z jhao joined #scheme 2014-10-20T22:59:52Z DrJepordyMan: vanila? 2014-10-20T23:01:27Z vanila: yeah OP is the function you pass in 2014-10-20T23:01:42Z vanila: and it gets called (op (car sequence) (accumulate .. stuff ..)) 2014-10-20T23:01:53Z vanila: so that's why x and y will be in the outermost call 2014-10-20T23:02:33Z ijp: DrJepordyMan: accumulate traverses the list from end to the beginning. the first argument to op is the element of the list you are currently at, the second argument is the "accumulated value" which is either initial (the first time) or the previous result of op 2014-10-20T23:04:18Z ijp: (accumulate f initial (list 1 2 3)) => (f 1 (f 2 (f 3 initial))) 2014-10-20T23:04:42Z ijp: rudybot: (define (accumulate op initial sequence) (if (null? sequence) initial (op (car sequence) (accumulate op initial (cdr sequence))))) 2014-10-20T23:04:43Z rudybot: ijp: your sandbox is ready 2014-10-20T23:04:43Z rudybot: ijp: Done. 2014-10-20T23:05:10Z ijp: rudybot: (accumulate (lambda (x y) `(f ,x ,y)) 'initial (list 1 2 3)) 2014-10-20T23:05:11Z rudybot: ijp: ; Value: '(f 1 (f 2 (f 3 initial))) 2014-10-20T23:05:18Z lrs quit (Ping timeout: 255 seconds) 2014-10-20T23:05:48Z ijp: ignore the magic, just know this is what would happen if you substituted it out 2014-10-20T23:05:55Z DrJepordyMan: what does `(f ,x ,y) mean? 2014-10-20T23:06:00Z ijp: ignore the magic 2014-10-20T23:06:36Z DrJepordyMan: but that's what im trying to do in my exercise 2014-10-20T23:06:54Z DrJepordyMan: and i still don't understand lambda, I understand accumulate now though 2014-10-20T23:07:04Z ijp: lambda is just a function 2014-10-20T23:07:29Z vanila: that's the same as (list 'f x y) 2014-10-20T23:07:30Z ijp: (lambda (x y) ) is a function of two arguments, x and y, that does foo 2014-10-20T23:07:41Z vanila: well it isn't exactly the same, but its similar 2014-10-20T23:07:46Z ijp: vanila: and SICP hasn't covered quote at this point either 2014-10-20T23:07:58Z jffmcc: Tell me when DrJMan's problem is solved. I dont want to confuse people by adding in another problem 2014-10-20T23:08:16Z vanila: jffmcc, you can ask now dont worry 2014-10-20T23:08:59Z ijp: we could always try answering your question before you tell us it 2014-10-20T23:09:46Z jffmcc: Alright. I just learned recursion today. Im trying to link my recursion (last2) with the function Last2Equal?(L) http://pastebin.com/1quJ4rTX 2014-10-20T23:10:05Z jffmcc: I most likely used recursion incorrectly 2014-10-20T23:10:08Z DrJepordyMan: I still don't understand how lambda works with accumulate however 2014-10-20T23:12:36Z ijp: so, suppose op is (lambda (x y) (+ x y)), initial is 0, and the sequence is (list 1 2 3) 2014-10-20T23:13:39Z ijp: then by substitution, and our previous discussion (accumulate (lambda (x y) (+ x y)) 0 (list 1 2 3)) is the same thing as ((lambda (x y) (+ x y)) 1 ((lambda (x y) (+ x y)) 2 ((lambda (x y) (+ x y)) 3 0))) 2014-10-20T23:14:31Z ijp: when you have a function you can substitute its argument into the body 2014-10-20T23:14:52Z ijp: so ((lambda (x y) (+ x y)) 3 0) => (+ 3 0) 2014-10-20T23:15:30Z ijp: then substituting two more times, you'd end up with (+ 1 (+ 2 (+ 3 0))) 2014-10-20T23:16:49Z DrJepordyMan: i see 2014-10-20T23:16:52Z ijp: https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.5 2014-10-20T23:17:46Z ijp: remember back to this section, since lambda creates functions, you use substitution, just like you did for named functions 2014-10-20T23:18:06Z stepnem quit (Ping timeout: 240 seconds) 2014-10-20T23:19:12Z ijp: jffmcc: you didn't use recursion at all 2014-10-20T23:19:44Z ijp: last2 is a function, but you treat it as a list 2014-10-20T23:20:49Z ijp: and you don't even call the inner function last2 2014-10-20T23:22:08Z jffmcc: Isnt recursion when you have a function and in the function you use the function? 2014-10-20T23:22:32Z ijp: when you call the function 2014-10-20T23:22:42Z ijp: you attempt to take the length of the function 2014-10-20T23:23:00Z jffmcc: The example my teacher gave was N!=N*(N-1)! except N>1 and when N=1, the answer is 1 2014-10-20T23:23:15Z ijp: I think the jury is out on whether or not (define (f) f) is recursive 2014-10-20T23:25:01Z jffmcc: Ok could you guide me through the steps? I want to create a recursion where I check the length of x, and if the length is greater than 2, cdr x is applied 2014-10-20T23:26:07Z jffmcc: cdr x is constantly applied until length x is equal to 2. When length x = 2, I want to check if car x = cadr x 2014-10-20T23:27:12Z jffmcc: If car x = cadr x, #t, else #f. If I do this, it will automatically #f if length x is less than 2 right? 2014-10-20T23:27:53Z ijp: if the length is less than 2, you will get an error 2014-10-20T23:29:41Z jffmcc: Ok then I would have to use cond: ((< (length x) 2) #f) 2014-10-20T23:29:59Z ijp: jffmcc: sorry, I was going by your description there, in your code, the case analysis is correct 2014-10-20T23:30:08Z ijp: in that else will handle it 2014-10-20T23:30:29Z jffmcc: Ok. 2014-10-20T23:30:45Z jffmcc: So first, I want to make the recursion 2014-10-20T23:30:48Z ijp: jffmcc: so (assuming you replaced the relevant last2's with x's), the only thing to fix is the first case 2014-10-20T23:31:23Z ijp: that is where you recursively call last2 on the cdr of x 2014-10-20T23:31:44Z ijp: jffmcc: what is the purpose of "Last2Equal?" 2014-10-20T23:32:34Z jffmcc: http://pastebin.com/PV07PtrP 2014-10-20T23:33:05Z jffmcc: Im going to ignore the Last2Equal? part and focus on the recursion, then link the recursion to the Last2Equal? 2014-10-20T23:34:52Z ijp: jffmcc: and you should use equal? rather than =, unless you only want this function to work for numbers 2014-10-20T23:35:39Z jffmcc: Ok thanks 2014-10-20T23:36:09Z DrJepordyMan: why doesn't this work? 2014-10-20T23:36:16Z DrJepordyMan: (define (my-map proc sequence) (accumulate (lambda (x y) ( (if (null? y) x (proc x y) ))) '() sequence)) 2014-10-20T23:36:28Z DrJepordyMan: i'll pastebin it actually 2014-10-20T23:36:47Z ijp: 1. what do you think it should do? 2. what did it actually do? 2014-10-20T23:36:48Z DrJepordyMan: http://pastebin.com/YfDGA1Xe 2014-10-20T23:37:12Z ijp: the most obvious problem is the extra pair of parens around the if 2014-10-20T23:37:38Z ijp: the second is that y will never be null? 2014-10-20T23:38:02Z DrJepordyMan: having extra parenthesis is a bad thing in scheme? 2014-10-20T23:38:06Z ijp: correction, it will, but only if the list contains nulls 2014-10-20T23:38:10Z ijp: DrJepordyMan: yes 2014-10-20T23:38:20Z DrJepordyMan: well i'm tying to do (my-map + '(1 2 3)) 2014-10-20T23:38:22Z ijp: DrJepordyMan: parentheses mean function application, not grouping 2014-10-20T23:38:30Z ijp: function/special-form 2014-10-20T23:38:32Z DrJepordyMan: and it complains that '() is not a number 2014-10-20T23:39:15Z ijp: rudybot: (define (my-map proc sequence) (accumulate (lambda (x y) ( (if (null? y) x (proc x y) ))) '() sequence)) 2014-10-20T23:39:17Z rudybot: ijp: Done. 2014-10-20T23:39:21Z ijp: rudybot: (my-map + '(1 2 3)) 2014-10-20T23:39:22Z rudybot: ijp: error: application: not a procedure; expected a procedure that can be applied to arguments given: 3 arguments...: [none] 2014-10-20T23:39:50Z ijp: well, I get a different error, namely the first one I pointed out 2014-10-20T23:41:13Z DrJepordyMan: it works for me now that the parenthesis are gone 2014-10-20T23:42:27Z ijp: hmm, actually, I was wrong about the null altogether, since x is the sequence argument, not y 2014-10-20T23:42:46Z ijp: DrJepordyMan: is my-map supposed to behave like map? 2014-10-20T23:43:00Z DrJepordyMan: yes 2014-10-20T23:43:10Z DrJepordyMan: i think so 2014-10-20T23:46:09Z DrJepordyMan: this should do it: http://pastebin.com/ws5WnpqL 2014-10-20T23:46:33Z ijp: DrJepordyMan: well, it doesn't really behave like map 2014-10-20T23:46:46Z ijp: rudybot: (define (square x) (* x x)) 2014-10-20T23:46:47Z rudybot: ijp: Done. 2014-10-20T23:46:53Z ijp: rudybot: (map square (list 1 2 3)) 2014-10-20T23:46:53Z rudybot: ijp: ; Value: '(1 4 9) 2014-10-20T23:47:00Z DrJepordyMan: oh i believe it's not supposed to be a map function 2014-10-20T23:47:20Z DrJepordyMan: i'm not really sure what this question was asking of me, just told me to complete the missing code 2014-10-20T23:47:56Z ijp: well, you can ask the audience, or gamble for the big money 2014-10-20T23:48:14Z ijp: rudybot: what is today's star prize? 2014-10-20T23:48:15Z rudybot: ijp: "Only six times in its 63-year history has the [Director's Guild of America] top prize not gone to someone who then went on to win the Oscar." 2014-10-20T23:49:04Z jffmcc: ijp I successfully solved the Last2Equal? problem. Thank you very much! 2014-10-20T23:49:23Z ijp: no problem 2014-10-20T23:49:38Z ijp: jffmcc: fwiw, in practice, you wouldn't want to repeatedly compute the length 2014-10-20T23:50:08Z jffmcc: So have a function that does it for you? 2014-10-20T23:50:43Z ijp: hold on, I'll post two different ways to do it 2014-10-20T23:51:02Z jffmcc: Here is what I got: http://pastebin.com/rtQUir60 2014-10-20T23:52:30Z joneshf-laptop joined #scheme 2014-10-20T23:54:31Z joneshf-laptop quit (Remote host closed the connection) 2014-10-20T23:58:28Z kongtomorrow joined #scheme