2014-10-05T00:00:43Z hiyosi joined #scheme 2014-10-05T00:02:54Z vanila quit (Quit: Leaving) 2014-10-05T00:05:41Z hiyosi quit (Ping timeout: 272 seconds) 2014-10-05T00:06:07Z Nizumzen quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/) 2014-10-05T00:06:58Z taylanub: lrs: no, it will do it if (pair? list) is true 2014-10-05T00:07:28Z taylanub: just read it like english 2014-10-05T00:07:37Z lrs: (if (pair? list) (listt? (cdr list)) #f))) 2014-10-05T00:07:58Z lrs: if pair? list then list? (cdr list) otherwise #f 2014-10-05T00:08:47Z taylanub: "if list is a pair, then the question is whether the cdr of 'list' is a list; otherwise the answer is 'false'" 2014-10-05T00:09:13Z taylanub: when I say "then the question is..." that's basically calling another function in tail-position for it to determine the return value for us 2014-10-05T00:09:31Z lrs: tail-position? 2014-10-05T00:09:47Z taylanub: "the last thing done in a function" 2014-10-05T00:10:00Z lrs: and why is there no car 2014-10-05T00:10:12Z taylanub: does it matter? 2014-10-05T00:10:23Z lrs: Ok sooooo 2014-10-05T00:10:33Z lrs: If I have 2014-10-05T00:10:35Z taylanub: is there ever a case where a chain of pairs are not considered a list because one of them has something wrong in a car position? 2014-10-05T00:10:58Z lrs: ( cons 1 (cons 2(cons 3()'))) 2014-10-05T00:11:13Z taylanub: that's bad syntax. and use proper spaces please 2014-10-05T00:11:24Z taylanub: I think you meant (cons 1 (cons 2 (cons 3 '()))) 2014-10-05T00:11:50Z taylanub: notice how for each 'cons' call, the first argument could be *anything* and it would still be a list 2014-10-05T00:11:51Z lrs: yes 2014-10-05T00:12:05Z lrs: Now if we look at 2014-10-05T00:12:08Z taylanub: those are the elements of the list, after all 2014-10-05T00:12:22Z lrs: (if (pair? list) (listt? (cdr list)) #f))) 2014-10-05T00:12:28Z lrs: It says if 2014-10-05T00:13:24Z lrs: (cons 1 (cons 2 (cons 3 '()))) is a pair which (cons 1 <- first element in pair (cons 2 (cons 3 '()))) second elemnt is pair 2014-10-05T00:14:15Z lrs: So that is true 2014-10-05T00:14:28Z lrs: So it does 2014-10-05T00:14:28Z lrs: (listt? (cdr list) 2014-10-05T00:14:30Z lrs: Right? 2014-10-05T00:14:59Z taylanub: yeah 2014-10-05T00:15:09Z lrs: So what does (listt? (cdr list) mean exatly 2014-10-05T00:15:20Z lrs: What operation does listt? do on the cdr lisst 2014-10-05T00:15:21Z taylanub: what's the cdr of the list? you just wrote it... 2014-10-05T00:15:32Z taylanub: er, listt? is the function you're defining there 2014-10-05T00:15:37Z lrs: Because you define listt? in the sam eparenthesis that you are using to call it.. 2014-10-05T00:15:54Z taylanub: I assume it was named 'listt?' to differentiate it from the built-in 'list?' 2014-10-05T00:16:04Z taylanub: lrs: yes, you can do that 2014-10-05T00:16:15Z lrs: Yes 2014-10-05T00:16:17Z taylanub: just do it step by step in your mind 2014-10-05T00:16:23Z taylanub: what's the cdr of list? 2014-10-05T00:16:29Z lrs: 1 2014-10-05T00:16:33Z taylanub: no 2014-10-05T00:16:43Z lrs: Woops 2014-10-05T00:16:45Z lrs: 2 3 2014-10-05T00:17:20Z taylanub: it's what you wrote as (cons 2 (cons 3 '())). (actually that's *code* resulting in the rest of the list, but yeah...) 2014-10-05T00:17:30Z taylanub: now apply 'list?' to that once more... 2014-10-05T00:19:50Z drdanmaku joined #scheme 2014-10-05T00:21:08Z taylanub goes AFK 2014-10-05T00:21:25Z lrs: taylanub, And what happens then? 2014-10-05T00:21:26Z lrs: :| 2014-10-05T00:21:40Z lrs: Is list?? defined as cdr list? 2014-10-05T00:21:42Z lrs: :S 2014-10-05T00:24:41Z kongtomorrow joined #scheme 2014-10-05T00:25:46Z taylanub: lrs: you were just applying it to (cons 1 (cons 2 (cons 3 '()))) step by step, no? then you arrived at (list? (cdr list)), and we said (cdr list) is (cons 2 (cons 3 '())). so why don't you now apply it step by step to (cons 2 (cons 3 '())) ? 2014-10-05T00:25:56Z taylanub: just continue applying it 2014-10-05T00:26:05Z lrs: Until (null) 2014-10-05T00:26:33Z taylanub: and then? 2014-10-05T00:26:47Z taylanub: what has 'list?' to say on null? 2014-10-05T00:26:57Z lrs: #t 2014-10-05T00:27:01Z lrs: :S 2014-10-05T00:27:03Z taylanub: so the result is? 2014-10-05T00:27:06Z lrs: #t 2014-10-05T00:27:19Z lrs: So the definition of a list 2014-10-05T00:27:27Z lrs: Is that it can do that, loop-thingy 2014-10-05T00:27:34Z taylanub: YES 2014-10-05T00:27:36Z lrs: (cons 1 (cons 2 (cons 3 '()))) -> to '() 2014-10-05T00:27:44Z taylanub: EXACTLY 2014-10-05T00:27:51Z lrs: Cool 2014-10-05T00:28:01Z lrs: That took me like, 2 weeks to realize. 2014-10-05T00:28:02Z lrs: Heh. 2014-10-05T00:28:08Z lrs: But now I got it 2014-10-05T00:28:10Z taylanub: you need to fling around emoticons less and just think more, then you'd be quicker 2014-10-05T00:28:16Z lrs: I thought it you called the function there 2014-10-05T00:28:32Z lrs: I usually dont write emoticons 2014-10-05T00:28:41Z taylanub: it was meant figuratively 2014-10-05T00:28:42Z lrs: Only when I want to appear stupid 2014-10-05T00:28:46Z lrs: Oh 2014-10-05T00:28:50Z lrs: ;_; 2014-10-05T00:28:55Z taylanub: but that works too yeah 2014-10-05T00:29:14Z taylanub: BTW you're in university? what field? 2014-10-05T00:29:18Z oldskirt joined #scheme 2014-10-05T00:29:19Z lrs: Mathematics 2014-10-05T00:29:33Z lrs: My second year 2014-10-05T00:29:57Z lrs: But, havnet completed all the stuff I have to do. But right now im doing Scheme/Python course 2014-10-05T00:29:59Z taylanub: and it has an optional CS course? 2014-10-05T00:30:06Z taylanub: ok 2014-10-05T00:30:11Z lrs: Nope, its required 2014-10-05T00:30:15Z taylanub: oh 2014-10-05T00:30:22Z taylanub: funny. not bad though 2014-10-05T00:30:48Z lrs: What do you mean? Mathematics as a major? 2014-10-05T00:31:01Z taylanub: that they force maths people to do Scheme 2014-10-05T00:31:24Z lrs: I guess its a way for us to think like a datalogician 2014-10-05T00:31:29Z lrs: Or what the correct term is 2014-10-05T00:31:49Z taylanub: computer scientist? 2014-10-05T00:31:57Z lrs: Right 2014-10-05T00:33:55Z lrs: Right now im gonna start to work with sets 2014-10-05T00:34:25Z oldskirt quit (Ping timeout: 272 seconds) 2014-10-05T00:35:31Z taylanub: now I'm long-term AFK, bye 2014-10-05T00:35:49Z tadni joined #scheme 2014-10-05T00:43:19Z lrs: taylanub, Thanks for the help! 2014-10-05T00:48:21Z oleo is now known as Guest85944 2014-10-05T00:48:36Z aretecode joined #scheme 2014-10-05T00:49:06Z Gyps joined #scheme 2014-10-05T00:49:54Z oleo__ joined #scheme 2014-10-05T00:51:57Z Guest85944 quit (Ping timeout: 260 seconds) 2014-10-05T00:54:00Z Rodya_ joined #scheme 2014-10-05T00:55:22Z aretecode quit (Remote host closed the connection) 2014-10-05T00:58:52Z c107 joined #scheme 2014-10-05T01:00:01Z arthurgleckler joined #scheme 2014-10-05T01:01:34Z hiyosi joined #scheme 2014-10-05T01:04:37Z theseb quit (Quit: Leaving) 2014-10-05T01:06:21Z hiyosi quit (Ping timeout: 260 seconds) 2014-10-05T01:15:57Z oldskirt joined #scheme 2014-10-05T01:17:39Z arthurgleckler quit (Remote host closed the connection) 2014-10-05T01:21:17Z oldskirt quit (Ping timeout: 272 seconds) 2014-10-05T01:26:28Z hiyosi joined #scheme 2014-10-05T01:27:26Z ehaliewicz joined #scheme 2014-10-05T01:31:11Z alexei___ quit (Ping timeout: 272 seconds) 2014-10-05T01:38:47Z tobik quit (Ping timeout: 272 seconds) 2014-10-05T01:40:12Z jusss joined #scheme 2014-10-05T01:40:30Z tobik joined #scheme 2014-10-05T01:56:11Z kongtomorrow quit 2014-10-05T02:03:18Z Nizumzen joined #scheme 2014-10-05T02:03:27Z Nizumzen quit (Client Quit) 2014-10-05T02:04:06Z davexunit quit (Quit: Later) 2014-10-05T02:04:46Z Nizumzen joined #scheme 2014-10-05T02:08:14Z davexunit joined #scheme 2014-10-05T02:08:20Z davexunit quit (Changing host) 2014-10-05T02:08:20Z davexunit joined #scheme 2014-10-05T02:16:42Z oldskirt joined #scheme 2014-10-05T02:16:57Z lrs quit (Ping timeout: 246 seconds) 2014-10-05T02:21:51Z oldskirt quit (Ping timeout: 272 seconds) 2014-10-05T02:27:01Z jeapostrophe joined #scheme 2014-10-05T02:27:27Z tadni` joined #scheme 2014-10-05T02:33:02Z davexunit quit (Quit: Later) 2014-10-05T02:34:20Z tadni quit (Ping timeout: 244 seconds) 2014-10-05T02:34:46Z tadni` quit (Ping timeout: 250 seconds) 2014-10-05T02:40:26Z tadni joined #scheme 2014-10-05T02:44:36Z petercommand is now known as seadogpeter 2014-10-05T02:51:57Z stepnem quit (Ping timeout: 246 seconds) 2014-10-05T03:17:27Z oldskirt joined #scheme 2014-10-05T03:19:30Z Nizumzen quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/) 2014-10-05T03:22:37Z oldskirt quit (Ping timeout: 260 seconds) 2014-10-05T03:43:33Z amgarching quit (Ping timeout: 272 seconds) 2014-10-05T03:46:12Z jeapostrophe quit (Ping timeout: 246 seconds) 2014-10-05T03:46:18Z karswell` quit (Remote host closed the connection) 2014-10-05T03:48:50Z karswell` joined #scheme 2014-10-05T03:49:17Z acarrico quit (Ping timeout: 260 seconds) 2014-10-05T03:49:37Z Gyps quit (Quit: Gyps) 2014-10-05T03:58:52Z Riastradh quit (Remote host closed the connection) 2014-10-05T03:59:07Z Riastradh joined #scheme 2014-10-05T04:01:02Z c107 quit (Remote host closed the connection) 2014-10-05T04:07:01Z tadni` joined #scheme 2014-10-05T04:08:53Z tadni quit (Ping timeout: 260 seconds) 2014-10-05T04:18:16Z oldskirt joined #scheme 2014-10-05T04:18:21Z oldskirt quit (Changing host) 2014-10-05T04:18:21Z oldskirt joined #scheme 2014-10-05T04:21:28Z Rodya_ quit (Quit: Ex-Chat) 2014-10-05T04:21:38Z drdanmaku quit (Quit: Connection closed for inactivity) 2014-10-05T04:22:57Z oldskirt quit (Ping timeout: 246 seconds) 2014-10-05T04:33:40Z kongtomorrow joined #scheme 2014-10-05T04:45:59Z theseb joined #scheme 2014-10-05T04:55:12Z vinleod joined #scheme 2014-10-05T04:59:18Z seadogpeter quit (Quit: leaving) 2014-10-05T04:59:29Z petercommand joined #scheme 2014-10-05T05:18:25Z anannie quit (Read error: Connection reset by peer) 2014-10-05T05:19:06Z oldskirt joined #scheme 2014-10-05T05:23:56Z oldskirt quit (Ping timeout: 260 seconds) 2014-10-05T05:29:45Z kazimir42 joined #scheme 2014-10-05T05:50:39Z kazimir42 quit (Ping timeout: 264 seconds) 2014-10-05T05:54:29Z oldskirt joined #scheme 2014-10-05T05:58:27Z bjz quit (Read error: Connection reset by peer) 2014-10-05T05:58:39Z bjz joined #scheme 2014-10-05T06:09:19Z kazimir42 joined #scheme 2014-10-05T06:11:37Z vinleod quit (Quit: ["Textual IRC Client: www.textualapp.com"]) 2014-10-05T06:26:32Z ehaliewicz quit (Ping timeout: 245 seconds) 2014-10-05T06:29:44Z daviid quit (Ping timeout: 260 seconds) 2014-10-05T06:34:54Z ananna joined #scheme 2014-10-05T06:40:01Z theseb quit (Quit: Leaving) 2014-10-05T06:42:29Z lrs joined #scheme 2014-10-05T06:52:30Z atomx_ joined #scheme 2014-10-05T06:58:28Z pnpuff joined #scheme 2014-10-05T07:00:41Z yacks quit (Quit: Leaving) 2014-10-05T07:12:51Z kazimir42 quit (Ping timeout: 264 seconds) 2014-10-05T07:18:56Z masm joined #scheme 2014-10-05T07:24:59Z phipes joined #scheme 2014-10-05T07:27:03Z zacts: hi 2014-10-05T07:27:03Z phipes quit (Client Quit) 2014-10-05T07:32:01Z kazimir42 joined #scheme 2014-10-05T07:33:10Z phipes joined #scheme 2014-10-05T07:33:13Z phipes quit (Client Quit) 2014-10-05T07:46:22Z atomx quit (Remote host closed the connection) 2014-10-05T07:46:22Z atomx_ quit (Remote host closed the connection) 2014-10-05T07:46:35Z atomx joined #scheme 2014-10-05T07:47:11Z fridim__ joined #scheme 2014-10-05T07:56:24Z pnpuff quit (Quit: Lost terminal) 2014-10-05T07:57:10Z kongtomorrow quit 2014-10-05T07:58:14Z aranhoide joined #scheme 2014-10-05T08:01:48Z yacks joined #scheme 2014-10-05T08:04:00Z lrs quit (Ping timeout: 260 seconds) 2014-10-05T08:05:04Z ilammy joined #scheme 2014-10-05T08:05:49Z jusss quit (Remote host closed the connection) 2014-10-05T08:06:42Z gnomon quit (Ping timeout: 250 seconds) 2014-10-05T08:18:48Z zacts: gn 2014-10-05T08:19:04Z gnomon joined #scheme 2014-10-05T08:35:43Z lrs joined #scheme 2014-10-05T08:41:48Z oldskirt_ joined #scheme 2014-10-05T08:44:08Z oldskirt quit (Ping timeout: 260 seconds) 2014-10-05T08:51:37Z b4283 joined #scheme 2014-10-05T09:01:55Z BossKonaSegwaY quit (Ping timeout: 258 seconds) 2014-10-05T09:17:38Z BossKonaSegwaY joined #scheme 2014-10-05T09:20:44Z ehaliewicz joined #scheme 2014-10-05T09:25:18Z ptcek joined #scheme 2014-10-05T09:28:29Z aftershave joined #scheme 2014-10-05T09:32:37Z vanila joined #scheme 2014-10-05T09:39:08Z sigjuice: I am having trouble understanding "3.3.5 Propagation of Constraints" from SICP. Why does process-forget-value call process-new-value in (define (adder a1 a2 sum) ... ) ? 2014-10-05T09:49:27Z BossKonaSegwaY quit (Ping timeout: 258 seconds) 2014-10-05T10:02:19Z BossKonaSegwaY joined #scheme 2014-10-05T10:11:12Z alexei___ joined #scheme 2014-10-05T10:17:01Z CaptainRant joined #scheme 2014-10-05T10:17:28Z CaptainRant: Can't a syntax rules template contain multiple templates ? 2014-10-05T10:17:56Z CaptainRant: I can specify a list of templates, but they expand parenthesized 2014-10-05T10:18:00Z ilammy: use (begin ...) if you want to place several forms into a template 2014-10-05T10:18:41Z CaptainRant: Great :D But not begin-syntax ? 2014-10-05T10:19:09Z ilammy: no, the plain old begin 2014-10-05T10:28:06Z CaptainRant: Literals are ignored inside syntax-rules ? Even if they equal existing identifier/rules/makros/keywords ? 2014-10-05T10:30:03Z ilammy: huh? what do you mean by 'ignored'? 2014-10-05T10:30:49Z CaptainRant: If i specify "if" as a literal, does it mean, that "if" is not visible inside the rule ? 2014-10-05T10:32:08Z ilammy: no, it still be that "if" which was defined at the place where the macro is defined 2014-10-05T10:32:39Z ilammy: literals mostly affect patterns 2014-10-05T10:33:12Z ilammy: if you specify "if" as a literal, you can match with a pattern _and_ it will not be a pattern variable 2014-10-05T10:33:17Z ptcek quit (Remote host closed the connection) 2014-10-05T10:33:25Z tadni` quit (Ping timeout: 260 seconds) 2014-10-05T10:33:39Z ilammy: you cannot use "if" in templates (as a literal) if it is a pattern variable 2014-10-05T10:34:11Z ilammy: because in this case "if" in templates will mean the thing bound to that pattern variable, not the "if" outside of the macro definition 2014-10-05T10:35:22Z ehaliewicz quit (Ping timeout: 240 seconds) 2014-10-05T10:56:43Z jeapostrophe joined #scheme 2014-10-05T11:18:48Z stepnem joined #scheme 2014-10-05T11:25:45Z bjz quit (Read error: Connection reset by peer) 2014-10-05T11:25:57Z bjz joined #scheme 2014-10-05T11:30:26Z oldskirt_ is now known as oldskirt 2014-10-05T11:32:38Z oleo__ quit (Quit: Verlassend) 2014-10-05T11:49:54Z newcomer joined #scheme 2014-10-05T11:58:17Z Nizumzen joined #scheme 2014-10-05T11:58:23Z Nizumzen quit (Client Quit) 2014-10-05T12:00:58Z Nizumzen joined #scheme 2014-10-05T12:01:17Z hiroakip joined #scheme 2014-10-05T12:05:21Z newcomer quit (Ping timeout: 260 seconds) 2014-10-05T12:05:32Z effy quit (Ping timeout: 258 seconds) 2014-10-05T12:05:58Z oldskirt_ joined #scheme 2014-10-05T12:07:27Z effy joined #scheme 2014-10-05T12:08:18Z yacks quit (Quit: Leaving) 2014-10-05T12:08:33Z yacks joined #scheme 2014-10-05T12:09:23Z oldskirt quit (Ping timeout: 244 seconds) 2014-10-05T12:11:24Z jusss joined #scheme 2014-10-05T12:11:58Z alexei___ quit (Ping timeout: 244 seconds) 2014-10-05T12:21:02Z davexunit joined #scheme 2014-10-05T12:21:23Z tadni joined #scheme 2014-10-05T12:26:54Z fantazo joined #scheme 2014-10-05T12:38:59Z lrs: http://pastebin.com/qspMhFdk < I have a function that takes the minimum of list 2014-10-05T12:39:26Z bjz quit (Read error: Connection reset by peer) 2014-10-05T12:39:47Z atomx quit (Ping timeout: 245 seconds) 2014-10-05T12:39:51Z bjz joined #scheme 2014-10-05T12:40:32Z lrs: And I want to create a function that takes the next biggest 2014-10-05T12:40:35Z lrs: number of a list 2014-10-05T12:42:55Z lrs: I switch the > term 2014-10-05T12:46:47Z vanila quit (Quit: Leaving) 2014-10-05T12:53:16Z araujo joined #scheme 2014-10-05T12:53:22Z araujo quit (Changing host) 2014-10-05T12:53:22Z araujo joined #scheme 2014-10-05T13:16:08Z civodul joined #scheme 2014-10-05T13:17:59Z DGASAU quit (Ping timeout: 272 seconds) 2014-10-05T13:18:12Z Nizumzen quit (Ping timeout: 245 seconds) 2014-10-05T13:20:13Z drdanmaku joined #scheme 2014-10-05T13:32:09Z emma quit (Ping timeout: 260 seconds) 2014-10-05T13:37:33Z taylanub: CaptainRant: (syntax-rules (if then else) ((_ (if x then y else z)) (if x y z))) will create a macro which when you pass it one argument like (if foo then bar else baz) it will expand to (if x y z) *UNLESS* you've lexically rebound 'if', 'then', or 'else' 2014-10-05T13:37:43Z taylanub: useless example but you get the idea 2014-10-05T13:38:28Z taylanub: CaptainRant: also, 'being unbound' also counts as a special binding state, so if during the macro creation 'then' and 'else' were unbound, then they need to be unbound when you call the macro; otherwise they're lexically rebound of course 2014-10-05T13:41:40Z taylanub quit (Disconnected by services) 2014-10-05T13:42:12Z taylanub joined #scheme 2014-10-05T13:48:24Z emma joined #scheme 2014-10-05T14:05:09Z vanila joined #scheme 2014-10-05T14:05:11Z taylanub: did my message about 'being unbound' arrive? 2014-10-05T14:06:27Z c74d: taylanub: I received it. 2014-10-05T14:06:36Z taylanub: thanks 2014-10-05T14:09:06Z jusss is now known as sssuj 2014-10-05T14:15:13Z yuv- quit (Ping timeout: 272 seconds) 2014-10-05T14:20:55Z CaptainRant quit (Ping timeout: 272 seconds) 2014-10-05T14:27:50Z sssuj quit (Remote host closed the connection) 2014-10-05T14:29:39Z kazimir42 quit (Ping timeout: 264 seconds) 2014-10-05T14:30:14Z hiroakip quit (Quit: Ex-Chat) 2014-10-05T14:30:33Z klltkr joined #scheme 2014-10-05T14:57:57Z oleo joined #scheme 2014-10-05T14:59:12Z HisaoNakai joined #scheme 2014-10-05T14:59:20Z klltkr quit (Quit: My MacBook has gone to sleep. ZZZzzz…) 2014-10-05T15:04:15Z atomx joined #scheme 2014-10-05T15:11:07Z CaptainRant joined #scheme 2014-10-05T15:14:47Z lrs: http://pastebin.com/2qd2gVyY 2014-10-05T15:14:50Z lrs: Anyone have any idea? 2014-10-05T15:15:06Z lrs: I need to take the next highest number in the list 2014-10-05T15:15:42Z atomx quit (Ping timeout: 250 seconds) 2014-10-05T15:16:57Z vanila: lrs, does that code work? 2014-10-05T15:17:12Z lrs: Nope 2014-10-05T15:17:17Z lrs: Im just guessing 2014-10-05T15:17:18Z lrs: :/ 2014-10-05T15:17:23Z lrs: It gives procedure 2014-10-05T15:19:29Z vanila: ok 2014-10-05T15:19:43Z vanila: why don't you SORT the list, then take the second element 2014-10-05T15:19:59Z vanila: (define (next-highest l) (cadr (sort l))) 2014-10-05T15:33:08Z hiroakip joined #scheme 2014-10-05T15:36:28Z alexei___ joined #scheme 2014-10-05T15:37:22Z lrs: vanila, sort huh 2014-10-05T15:48:40Z lrs: vanila, 2014-10-05T15:49:11Z lrs: vanila, http://pastebin.com/yYpTkaZQ 2014-10-05T15:49:12Z lrs: :S 2014-10-05T15:49:37Z b4283 quit (Quit: Konversation terminated!) 2014-10-05T15:50:35Z vanila: lrs, http://lpaste.net/112134 2014-10-05T15:50:48Z yacks quit (Ping timeout: 250 seconds) 2014-10-05T15:51:24Z lrs: I did that first befroe. Hm. 2014-10-05T15:51:58Z lrs: vanila, It says "undefined" when i enter 2014-10-05T15:52:03Z lrs: > (next-highest (list 1 2 3 4 5 6 )) 2014-10-05T15:52:04Z lrs: :| 2014-10-05T15:55:04Z vanila: what is undefined 2014-10-05T15:55:14Z lrs: ext-highest: undefined; 2014-10-05T15:55:14Z lrs: cannot reference undefined identifier 2014-10-05T15:55:19Z lrs: *n 2014-10-05T15:58:42Z daviid joined #scheme 2014-10-05T16:00:28Z taylanub: lrs: you have to indent your code properly 2014-10-05T16:01:58Z taylanub: (define (next-highest lst) 2014-10-05T16:01:58Z taylanub: (cond ((null? (cdr lst)) (car lst)) 2014-10-05T16:01:58Z taylanub: (cadr (sort l)))) 2014-10-05T16:01:58Z taylanub: Here. Now does this look correct? Or does something in the structure sting to the eye? 2014-10-05T16:03:11Z lrs: lst instead of l 2014-10-05T16:03:26Z taylanub: No. As made clear from the indentation, "(cadr (sort l))" is in a position of a "cond clause". What's the grammar of a cond clause? 2014-10-05T16:03:38Z lrs: ?? 2014-10-05T16:03:42Z lrs: Its supposed to be lst instead of l 2014-10-05T16:03:51Z lrs: (cadr (sort lst) 2014-10-05T16:03:54Z taylanub: The grammar of a cond clause is ( ...). 2014-10-05T16:04:07Z taylanub: Where is the test in "(cdr (sort l))"? 2014-10-05T16:04:34Z lrs: The test? 2014-10-05T16:04:40Z lrs: else 2014-10-05T16:04:56Z taylanub: obviously "cdr" is not a test. (it *incidentally* works as a test, counting as 'true', because everything but #f counts as true) 2014-10-05T16:05:50Z taylanub: (er, "cadr" not "cdr" .. anyway) 2014-10-05T16:06:02Z taylanub: lrs: I see no "else" there 2014-10-05T16:06:36Z taylanub: I just see "(cadr (sort l))", and if you match that up with the grammar ( ...) it means "cadr" is in position of the 2014-10-05T16:07:48Z lrs: What is a test 2014-10-05T16:08:34Z taylanub: A in a cond clause may be any expression, or the symbol 'else' if the clause is the last cond clause. 2014-10-05T16:09:02Z taylanub: The symbol 'else' is equivalent to the constant expression '#t'. 2014-10-05T16:11:43Z lrs: I dont get it 2014-10-05T16:11:53Z lrs: What do suggest it says instead 2014-10-05T16:16:50Z taylanub: (else (cadr (sort l))) 2014-10-05T16:17:30Z lrs: Thats what I said :| 2014-10-05T16:17:35Z taylanub: (define (next-highest lst) 2014-10-05T16:17:35Z taylanub: (cond ((null? (cdr lst)) (car lst)) 2014-10-05T16:17:35Z taylanub: (else (cadr (sort l))))) 2014-10-05T16:17:48Z lrs: Huh 2014-10-05T16:17:53Z lrs: Why do you switch l and switch 2014-10-05T16:17:55Z lrs: I mean 2014-10-05T16:17:59Z lrs: switch l and lst 2014-10-05T16:18:10Z taylanub: I didn't correct the other mistake, I was concentrating on the lack of an 'else' 2014-10-05T16:18:30Z lrs: Ok, just wanted to be sure 2014-10-05T16:18:30Z lrs: (define (next-highest l) 2014-10-05T16:18:31Z lrs: (cond ((null? (cdr l)) (car l)) 2014-10-05T16:18:31Z lrs: (else(cadr (sort l))))) 2014-10-05T16:18:50Z taylanub: maybe I'm making this too difficult -- I could have just said "you forgot the else there", but it would be great if you got accustomed to reading precise grammar 2014-10-05T16:19:30Z lrs: Right 2014-10-05T16:19:31Z lrs: BUt 2014-10-05T16:19:34Z lrs: That code doesnt work 2014-10-05T16:19:37Z lrs: :| 2014-10-05T16:19:57Z taylanub: (well, to be fair, one wouldn't expect that from a beginner in programming, but given that you're approaching it as a mathematician I'd say it's fine to expect that level of rigor?) 2014-10-05T16:20:46Z taylanub: on to the next issue ... 2014-10-05T16:21:48Z taylanub: lrs: what happens when you use that function? like when you call (next-highest (list 4 2 8 3))? 2014-10-05T16:25:12Z alexei___ quit (Ping timeout: 260 seconds) 2014-10-05T16:25:15Z lrs: sort: arity mismatch; 2014-10-05T16:25:15Z lrs: the expected number of arguments does not match the given number 2014-10-05T16:25:15Z lrs: expected: 2 plus optional arguments with keywords #:cache-keys? and #:key 2014-10-05T16:25:15Z lrs: given: 1 2014-10-05T16:25:15Z lrs: arguments...: 2014-10-05T16:25:16Z lrs: (4 2 8 3) 2014-10-05T16:35:25Z kongtomorrow joined #scheme 2014-10-05T16:35:54Z alexei___ joined #scheme 2014-10-05T16:36:20Z pera joined #scheme 2014-10-05T16:41:03Z lrs: taylanub, Any idea 2014-10-05T16:41:04Z lrs: :S 2014-10-05T16:42:00Z oldskirt_ quit (Ping timeout: 260 seconds) 2014-10-05T16:42:46Z taylanub: lrs: isn't the error pretty clear? you didn't give 'sort' the number of arguments it expected 2014-10-05T16:43:14Z taylanub: lrs: read the documentation of 'sort' to see what arguments it expects 2014-10-05T16:52:03Z HisaoNakai quit (Remote host closed the connection) 2014-10-05T16:53:04Z kongtomorrow quit 2014-10-05T16:58:12Z alexei___ quit (Ping timeout: 244 seconds) 2014-10-05T16:58:20Z lrs: taylanub, 2014-10-05T16:58:37Z lrs: http://docs.racket-lang.org/reference/pairs.html?q=scheme#%28def._%28%28lib._racket%2Fprivate%2Flist..rkt%29._sort%29%29 2014-10-05T16:58:38Z rudybot: http://tinyurl.com/qxegkrj 2014-10-05T16:59:06Z lrs: Doesnt work 2014-10-05T16:59:09Z lrs: Im assuming its 2014-10-05T16:59:14Z lrs: (next-highest 3 (list 4 2 8 3)) 2014-10-05T16:59:15Z lrs: or 2014-10-05T16:59:20Z lrs: (next-highest (list 4 2 8 3) 3) 2014-10-05T16:59:41Z taylanub: lrs: did you read what I wrote? 2014-10-05T17:00:06Z lrs: ? 2014-10-05T17:00:13Z lrs: I dont get it, how many arguments? 2014-10-05T17:00:26Z lrs: Where? 2014-10-05T17:00:30Z taylanub: well, is the documentation not clear enough? 2014-10-05T17:00:39Z lrs: Boolean? 2014-10-05T17:00:42Z taylanub: lrs: so how many arguments does sort take? 2014-10-05T17:00:53Z lrs: 1 2014-10-05T17:00:59Z lrs: 2 2014-10-05T17:01:05Z lrs: list 2014-10-05T17:01:06Z lrs: and less-than? 2014-10-05T17:01:14Z taylanub: (to be honest, I find that format they use there for types pretty horrible...) 2014-10-05T17:01:17Z taylanub: lrs: yeah 2014-10-05T17:01:24Z sheilong joined #scheme 2014-10-05T17:01:26Z taylanub: lrs: how many did you give to sort? 2014-10-05T17:04:35Z Riastradh quit (Remote host closed the connection) 2014-10-05T17:04:42Z lrs: Hmm 2014-10-05T17:04:46Z lrs: Heh. 2014-10-05T17:04:49Z Riastradh joined #scheme 2014-10-05T17:05:21Z lrs: Where do i set the arugment or that? 2014-10-05T17:05:33Z lrs: If i write (sort 2 l) 2014-10-05T17:05:35Z lrs: It doesnt wor 2014-10-05T17:06:52Z effy quit (Quit: No Ping reply in 180 seconds.) 2014-10-05T17:06:59Z taylanub: whenever you say "it doesn't work", read the actual error message instead 2014-10-05T17:07:17Z effy joined #scheme 2014-10-05T17:16:14Z aftershave quit (Quit: Textual IRC Client: www.textualapp.com) 2014-10-05T17:16:40Z aftershave joined #scheme 2014-10-05T17:18:26Z yacks joined #scheme 2014-10-05T17:18:40Z zacts: hi 2014-10-05T17:19:20Z offby1: egg zacts ly 2014-10-05T17:19:47Z BossKonaSegwaY quit (Ping timeout: 245 seconds) 2014-10-05T17:20:39Z zacts: hi offby1 2014-10-05T17:20:49Z zacts: I hope to write a few chicken eggs eventually 2014-10-05T17:21:03Z zacts: chicken is my favorite scheme right now 2014-10-05T17:22:06Z alexei___ joined #scheme 2014-10-05T17:23:41Z offby1: I've barely used it. 2014-10-05T17:32:07Z zacts: offby1: it's fun 2014-10-05T17:32:14Z zacts: and it compiles to C 2014-10-05T17:35:29Z BossKonaSegwaY joined #scheme 2014-10-05T17:35:43Z lrs: taylanub, I did 2014-10-05T17:36:01Z lrs: sort: contract violation 2014-10-05T17:36:01Z lrs: expected: list? 2014-10-05T17:36:01Z lrs: given: 2 2014-10-05T17:40:15Z gravicappa joined #scheme 2014-10-05T17:41:00Z offby1: rudybot: (sort 2 <) 2014-10-05T17:41:00Z rudybot: *offby1: error: sort: contract violation expected: list? given: 2 2014-10-05T17:41:06Z offby1: rudybot: (sort (list 2) <) 2014-10-05T17:41:06Z rudybot: *offby1: ; Value: '(2) 2014-10-05T17:41:12Z offby1: rudybot: (sort (list 3 2 1 100) <) 2014-10-05T17:41:12Z rudybot: *offby1: ; Value: '(1 2 3 100) 2014-10-05T17:48:29Z kongtomorrow joined #scheme 2014-10-05T17:53:02Z c107 joined #scheme 2014-10-05T17:53:21Z aftershave quit (Quit: Textual IRC Client: www.textualapp.com) 2014-10-05T17:53:52Z fantazo quit (Ping timeout: 260 seconds) 2014-10-05T17:59:44Z atomx joined #scheme 2014-10-05T18:06:13Z lrs: taylanub, Any ideas? 2014-10-05T18:06:15Z lrs: ;_; 2014-10-05T18:07:14Z kongtomorrow quit 2014-10-05T18:07:51Z taylanub: lrs: offby1 just demonstrated how to use it correctly... 2014-10-05T18:08:12Z lrs: Oh shit 2014-10-05T18:08:20Z lrs: I thought it was a bot going haywire 2014-10-05T18:09:44Z atomx quit (Remote host closed the connection) 2014-10-05T18:17:42Z sheilong quit (Ping timeout: 250 seconds) 2014-10-05T18:18:50Z rtra` joined #scheme 2014-10-05T18:19:33Z lrs: offby1, thanks ^ 2014-10-05T18:19:35Z lrs: ^^ 2014-10-05T18:19:45Z lrs: I just changed the < to > 2014-10-05T18:20:09Z lrs: Any ideas how I could do it without uing sort? 2014-10-05T18:21:42Z ivanshmakov quit (Changing host) 2014-10-05T18:21:43Z ivanshmakov joined #scheme 2014-10-05T18:22:20Z rtra quit (Ping timeout: 260 seconds) 2014-10-05T18:22:20Z rtra` is now known as rtra 2014-10-05T18:22:36Z civodul quit (Remote host closed the connection) 2014-10-05T18:22:56Z civodul joined #scheme 2014-10-05T18:46:48Z HisaoNakai joined #scheme 2014-10-05T18:47:33Z BossKonaSegwaY quit (Ping timeout: 260 seconds) 2014-10-05T18:54:30Z oldskirt joined #scheme 2014-10-05T18:59:17Z fantazo joined #scheme 2014-10-05T18:59:55Z sheilong joined #scheme 2014-10-05T19:07:25Z BossKonaSegwaY joined #scheme 2014-10-05T19:09:03Z kwmiebach______ joined #scheme 2014-10-05T19:17:00Z _tca: lrs: why would you do it without sort? 2014-10-05T19:17:07Z lrs: To learn 2014-10-05T19:17:30Z _tca: you could implement sort 2014-10-05T19:17:39Z _tca: or take the max, remove it, and do it again 2014-10-05T19:21:09Z lrs: Thats what I want to do 2014-10-05T19:22:21Z _tca: could also make a 3 parameter variant max that returns the 2 highest of the 3 and use that to reduce them 2014-10-05T19:22:32Z _tca: you could do all 3 ways 2014-10-05T19:26:55Z lrs: Can you show me those? 2014-10-05T19:27:54Z hiroakip quit (Ping timeout: 258 seconds) 2014-10-05T19:38:04Z bars0 joined #scheme 2014-10-05T19:38:13Z karswell` quit (Read error: Connection reset by peer) 2014-10-05T19:39:24Z bars0 quit (Client Quit) 2014-10-05T19:40:53Z karswell` joined #scheme 2014-10-05T19:43:22Z hiyosi quit (Ping timeout: 240 seconds) 2014-10-05T19:44:36Z ngz joined #scheme 2014-10-05T19:56:37Z pygospa joined #scheme 2014-10-05T20:19:05Z c107 quit (Remote host closed the connection) 2014-10-05T20:40:25Z hiyosi joined #scheme 2014-10-05T20:48:38Z hiyosi quit (Ping timeout: 244 seconds) 2014-10-05T20:50:42Z [Batou] joined #scheme 2014-10-05T20:51:00Z kongtomorrow joined #scheme 2014-10-05T20:52:22Z HisaoNakai quit (Ping timeout: 245 seconds) 2014-10-05T20:52:31Z [Batou] is now known as HisaoNakai 2014-10-05T20:53:55Z acarrico joined #scheme 2014-10-05T20:54:33Z civodul quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-05T21:04:07Z fantazo quit (Ping timeout: 272 seconds) 2014-10-05T21:06:09Z oldskirt quit (Ping timeout: 260 seconds) 2014-10-05T21:06:09Z gravicappa quit (Ping timeout: 260 seconds) 2014-10-05T21:06:19Z oldskirt joined #scheme 2014-10-05T21:09:26Z stepnem quit (Ping timeout: 272 seconds) 2014-10-05T21:13:57Z hiroakip joined #scheme 2014-10-05T21:16:24Z sheilong quit (Quit: Konversation terminated!) 2014-10-05T21:16:32Z oldskirt quit (Ping timeout: 244 seconds) 2014-10-05T21:18:07Z hiroakip quit (Remote host closed the connection) 2014-10-05T21:18:41Z ngz quit (Ping timeout: 272 seconds) 2014-10-05T21:20:18Z hiroakip joined #scheme 2014-10-05T21:23:00Z tadni quit (Remote host closed the connection) 2014-10-05T21:24:20Z fridim__ quit (Ping timeout: 260 seconds) 2014-10-05T21:25:12Z tadni joined #scheme 2014-10-05T21:26:05Z hiroakip quit (Remote host closed the connection) 2014-10-05T21:26:31Z hiroakip joined #scheme 2014-10-05T21:31:48Z hiroakip quit (Ping timeout: 260 seconds) 2014-10-05T21:32:16Z CaptainRant quit (Ping timeout: 250 seconds) 2014-10-05T21:33:40Z HisaoNakai quit (Remote host closed the connection) 2014-10-05T21:33:51Z niklasl quit (Quit: Nettalk6 - www.ntalk.de) 2014-10-05T21:35:47Z niklasl joined #scheme 2014-10-05T21:35:47Z daviid quit (Remote host closed the connection) 2014-10-05T21:36:27Z kongtomorrow quit 2014-10-05T21:38:04Z hiroakip joined #scheme 2014-10-05T21:38:39Z hiroakip quit (Remote host closed the connection) 2014-10-05T21:39:17Z hiroakip joined #scheme 2014-10-05T21:42:48Z hiroakip quit (Remote host closed the connection) 2014-10-05T21:43:25Z hiroakip joined #scheme 2014-10-05T21:44:56Z hiyosi joined #scheme 2014-10-05T21:50:01Z hiyosi quit (Ping timeout: 260 seconds) 2014-10-05T21:51:35Z ehaliewicz joined #scheme 2014-10-05T21:59:25Z Vutral quit (Ping timeout: 260 seconds) 2014-10-05T22:11:31Z ilammy quit (Ping timeout: 246 seconds) 2014-10-05T22:12:52Z hiroakip quit (Ping timeout: 260 seconds) 2014-10-05T22:13:14Z Vutral joined #scheme 2014-10-05T22:13:49Z vanila quit (Quit: Leaving) 2014-10-05T22:17:42Z masm quit (Ping timeout: 245 seconds) 2014-10-05T22:20:14Z _tca: lrs: you should check out the little schemer and seasoned schemer, it's filled with exercises like those 2014-10-05T22:25:05Z hiyosi joined #scheme 2014-10-05T22:27:03Z MouldyOldBones joined #scheme 2014-10-05T22:58:41Z Vutral quit (Ping timeout: 260 seconds) 2014-10-05T23:05:07Z Vutral joined #scheme 2014-10-05T23:05:23Z vinleod joined #scheme 2014-10-05T23:06:18Z emma quit (Ping timeout: 250 seconds) 2014-10-05T23:18:38Z Rodya_ joined #scheme 2014-10-05T23:20:32Z fikusz quit (Ping timeout: 272 seconds) 2014-10-05T23:29:06Z c107 joined #scheme 2014-10-05T23:32:06Z mrowe_away is now known as mrowe 2014-10-05T23:35:00Z phipes joined #scheme 2014-10-05T23:35:29Z kongtomorrow joined #scheme 2014-10-05T23:42:52Z emma joined #scheme 2014-10-05T23:43:33Z githogori joined #scheme 2014-10-05T23:45:24Z phipes quit (Quit: My MacBook has gone to sleep. ZZZzzz…) 2014-10-05T23:47:03Z emma quit (Ping timeout: 246 seconds) 2014-10-05T23:55:18Z emma joined #scheme