2014-10-09T00:07:19Z ANGRYSTEVE quit (Quit: Sunya in my bunya) 2014-10-09T00:21:27Z cam quit (Ping timeout: 245 seconds) 2014-10-09T00:21:57Z cam joined #scheme 2014-10-09T00:22:21Z cam is now known as Guest435 2014-10-09T00:23:16Z kvda joined #scheme 2014-10-09T00:37:31Z mornfall quit (Ping timeout: 272 seconds) 2014-10-09T00:42:29Z jusss joined #scheme 2014-10-09T00:44:49Z mornfall joined #scheme 2014-10-09T00:50:13Z kongtomorrow joined #scheme 2014-10-09T01:09:56Z tadni joined #scheme 2014-10-09T01:15:44Z BossKonaSegwaY quit (Ping timeout: 260 seconds) 2014-10-09T01:23:08Z BossKonaSegwaY joined #scheme 2014-10-09T01:26:14Z bones quit (Disconnected by services) 2014-10-09T01:26:38Z bones joined #scheme 2014-10-09T01:28:41Z bones quit (Client Quit) 2014-10-09T01:33:19Z bjz_ joined #scheme 2014-10-09T01:34:09Z bjz quit (Ping timeout: 258 seconds) 2014-10-09T01:34:33Z tobik quit (Ping timeout: 246 seconds) 2014-10-09T01:36:01Z tobik joined #scheme 2014-10-09T01:43:26Z kongtomorrow quit 2014-10-09T01:43:43Z jcloud joined #scheme 2014-10-09T02:00:39Z b4283 joined #scheme 2014-10-09T02:04:56Z zacts: yo 2014-10-09T02:05:12Z atomx quit (Ping timeout: 258 seconds) 2014-10-09T02:07:29Z _tca: hi 2014-10-09T02:13:35Z robot-beethoven joined #scheme 2014-10-09T02:15:47Z pjb: lo 2014-10-09T02:19:23Z bpalmer joined #scheme 2014-10-09T02:26:58Z atomx joined #scheme 2014-10-09T02:27:02Z atomx quit (Remote host closed the connection) 2014-10-09T02:27:15Z atomx joined #scheme 2014-10-09T02:31:26Z davexunit quit (Quit: Later) 2014-10-09T02:41:03Z kvda: hu 2014-10-09T02:55:28Z kongtomorrow joined #scheme 2014-10-09T02:56:46Z omefire quit (Read error: Connection reset by peer) 2014-10-09T02:58:12Z omefire1 joined #scheme 2014-10-09T03:06:18Z offby1: rk 2014-10-09T03:08:49Z alexei_ joined #scheme 2014-10-09T03:11:03Z guampa quit (Ping timeout: 264 seconds) 2014-10-09T03:11:54Z amgarching quit (Ping timeout: 250 seconds) 2014-10-09T03:13:09Z guampa joined #scheme 2014-10-09T03:21:17Z kongtomorrow quit 2014-10-09T03:47:22Z fridim__ quit (Ping timeout: 240 seconds) 2014-10-09T04:00:18Z MichaelRaskin quit (Quit: MichaelRaskin) 2014-10-09T04:00:58Z bb010g joined #scheme 2014-10-09T04:26:06Z theseb joined #scheme 2014-10-09T04:30:26Z cataska quit (Remote host closed the connection) 2014-10-09T04:32:11Z guampa quit (Remote host closed the connection) 2014-10-09T04:32:37Z karswell quit (Read error: Connection reset by peer) 2014-10-09T04:32:55Z guampa joined #scheme 2014-10-09T04:40:46Z vinleod joined #scheme 2014-10-09T04:45:30Z acarrico quit (Ping timeout: 250 seconds) 2014-10-09T04:53:51Z kongtomorrow joined #scheme 2014-10-09T05:02:00Z cataska joined #scheme 2014-10-09T05:02:06Z taylanub quit (Read error: Connection reset by peer) 2014-10-09T05:02:09Z c74d quit (Remote host closed the connection) 2014-10-09T05:02:25Z oleo__ joined #scheme 2014-10-09T05:03:07Z oleo is now known as Guest87600 2014-10-09T05:03:32Z Guest87600 quit (Ping timeout: 245 seconds) 2014-10-09T05:05:13Z ivanshmakov quit (Remote host closed the connection) 2014-10-09T05:06:19Z wingo joined #scheme 2014-10-09T05:06:35Z kongtomorrow quit 2014-10-09T05:06:44Z c74d joined #scheme 2014-10-09T05:09:42Z ivanshmakov joined #scheme 2014-10-09T05:10:25Z kongtomorrow joined #scheme 2014-10-09T05:21:25Z kongtomorrow quit (Read error: Connection reset by peer) 2014-10-09T05:21:58Z kongtomorrow joined #scheme 2014-10-09T05:23:41Z zacts: lo 2014-10-09T05:23:45Z kongtomorrow quit (Client Quit) 2014-10-09T05:28:04Z pnpuff joined #scheme 2014-10-09T05:33:25Z alexei_ quit (Ping timeout: 260 seconds) 2014-10-09T05:35:58Z c107 quit (Remote host closed the connection) 2014-10-09T05:45:10Z oleo__ quit (Quit: Verlassend) 2014-10-09T05:45:59Z theseb quit (Quit: Leaving) 2014-10-09T05:49:05Z zzach quit 2014-10-09T05:58:18Z pnpuff quit (Ping timeout: 256 seconds) 2014-10-09T06:02:25Z frkout_ joined #scheme 2014-10-09T06:02:26Z xinix joined #scheme 2014-10-09T06:04:27Z tcsc quit (Quit: computer sleeping) 2014-10-09T06:05:09Z bars0 joined #scheme 2014-10-09T06:05:17Z frkout quit (Ping timeout: 245 seconds) 2014-10-09T06:11:57Z drdanmaku quit (Quit: Connection closed for inactivity) 2014-10-09T06:13:00Z masm joined #scheme 2014-10-09T06:21:14Z bars0 quit (Quit: leaving) 2014-10-09T06:36:52Z mrowe is now known as mrowe_away 2014-10-09T06:39:30Z ecraven: what's a good name for a type of records that automatically keeps a dirty flag for each field? (define-x-record-type ...) 2014-10-09T06:39:43Z frkout_ quit (Remote host closed the connection) 2014-10-09T06:40:10Z frkout joined #scheme 2014-10-09T06:45:46Z kvda quit (Quit: z____z) 2014-10-09T06:56:11Z noncom joined #scheme 2014-10-09T06:58:56Z noncom|2 quit (Ping timeout: 256 seconds) 2014-10-09T07:24:04Z robot-beethoven quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-09T07:26:38Z fridim_ joined #scheme 2014-10-09T07:30:45Z lewis1711 joined #scheme 2014-10-09T07:30:56Z lewis1711: is there any situation where an improper list should be used? 2014-10-09T07:31:09Z lewis1711: guess I'm struggling to see the point of them 2014-10-09T07:40:01Z taylanub joined #scheme 2014-10-09T07:47:04Z ecraven: lewis1711: they are a product of the fact that lists are created from pairs (which don't *have* to have a list as their second element) 2014-10-09T07:47:23Z ecraven: single pairs I use sometimes, longer improper lists, not sure :-/ 2014-10-09T08:00:35Z DGASAU quit (Read error: Connection reset by peer) 2014-10-09T08:01:04Z DGASAU` joined #scheme 2014-10-09T08:05:10Z DGASAU` is now known as DGASAU 2014-10-09T08:11:11Z MichaelRaskin joined #scheme 2014-10-09T08:15:55Z pnkfelix joined #scheme 2014-10-09T08:31:12Z FracV quit (Quit: leaving) 2014-10-09T08:34:22Z MichaelRaskin quit (Ping timeout: 240 seconds) 2014-10-09T08:45:34Z Riastradh joined #scheme 2014-10-09T08:53:07Z lrs joined #scheme 2014-10-09T09:02:30Z stepnem joined #scheme 2014-10-09T09:03:34Z xinix quit (Quit: Leaving) 2014-10-09T09:05:03Z Riastradh quit (Ping timeout: 264 seconds) 2014-10-09T09:13:38Z kuribas joined #scheme 2014-10-09T09:18:30Z lrs quit (Ping timeout: 250 seconds) 2014-10-09T09:20:41Z DGASAU quit (Read error: Connection reset by peer) 2014-10-09T09:21:10Z DGASAU joined #scheme 2014-10-09T09:22:31Z Riastradh joined #scheme 2014-10-09T09:28:27Z Riastradh quit (Ping timeout: 264 seconds) 2014-10-09T09:35:20Z jusss quit (Quit: ERC Version 5.2 (IRC client for Emacs)) 2014-10-09T09:44:15Z b4283 quit (Quit: Konversation terminated!) 2014-10-09T10:04:19Z gravicappa joined #scheme 2014-10-09T10:06:33Z DGASAU quit (Read error: Connection reset by peer) 2014-10-09T10:07:00Z DGASAU joined #scheme 2014-10-09T10:20:05Z pnkfelix quit (Ping timeout: 258 seconds) 2014-10-09T10:22:00Z FracV joined #scheme 2014-10-09T10:39:19Z jeapostrophe joined #scheme 2014-10-09T10:39:56Z lrs joined #scheme 2014-10-09T10:44:48Z vanila joined #scheme 2014-10-09T10:47:32Z vanila: anyone know why bigloo doesn't use CPS? 2014-10-09T10:57:21Z vinleod quit (Quit: Computer has gone to sleep.) 2014-10-09T11:02:57Z lewis1711 quit (Ping timeout: 246 seconds) 2014-10-09T11:08:04Z pnkfelix joined #scheme 2014-10-09T11:10:32Z pnkfelix quit (Client Quit) 2014-10-09T11:16:06Z pnkfelix joined #scheme 2014-10-09T11:22:16Z acarrico joined #scheme 2014-10-09T11:27:32Z fizzie quit (Ping timeout: 260 seconds) 2014-10-09T11:34:12Z przl joined #scheme 2014-10-09T11:47:03Z psy_ quit (Ping timeout: 246 seconds) 2014-10-09T11:49:28Z ivanshmakov quit (Ping timeout: 260 seconds) 2014-10-09T11:52:15Z fizzie joined #scheme 2014-10-09T11:55:17Z ivanshmakov joined #scheme 2014-10-09T12:03:46Z xinix joined #scheme 2014-10-09T12:18:57Z emma quit (Ping timeout: 245 seconds) 2014-10-09T12:28:03Z emma joined #scheme 2014-10-09T12:37:32Z jusss joined #scheme 2014-10-09T12:54:30Z davexunit joined #scheme 2014-10-09T12:56:42Z BossKonaSegwaY quit (Ping timeout: 246 seconds) 2014-10-09T12:57:45Z przl quit (Ping timeout: 244 seconds) 2014-10-09T13:01:02Z mutley89 quit (Ping timeout: 245 seconds) 2014-10-09T13:02:47Z jeapostrophe quit (Ping timeout: 245 seconds) 2014-10-09T13:11:12Z vanila quit (Remote host closed the connection) 2014-10-09T13:11:31Z developernotes joined #scheme 2014-10-09T13:14:13Z b4283 joined #scheme 2014-10-09T13:27:34Z developernotes quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2014-10-09T13:27:55Z drdanmaku joined #scheme 2014-10-09T13:28:44Z developernotes joined #scheme 2014-10-09T13:29:02Z BossKonaSegwaY joined #scheme 2014-10-09T13:39:57Z jeapostrophe joined #scheme 2014-10-09T13:40:40Z defanor quit (Ping timeout: 272 seconds) 2014-10-09T13:41:32Z taylanub quit (Disconnected by services) 2014-10-09T13:42:21Z taylanub joined #scheme 2014-10-09T13:42:28Z oleo joined #scheme 2014-10-09T13:43:22Z defanor joined #scheme 2014-10-09T13:45:24Z sethalves: vanila -- I don't really know the answer, but I do know that one of the goals of bigloo is to be interoperable with C (++?) 2014-10-09T13:51:02Z b4283 quit (Ping timeout: 245 seconds) 2014-10-09T13:54:17Z defanor quit (Quit: giving up on this server) 2014-10-09T13:54:21Z przl joined #scheme 2014-10-09T13:55:11Z defanor joined #scheme 2014-10-09T14:05:29Z vanila joined #scheme 2014-10-09T14:16:33Z pygospa quit (Remote host closed the connection) 2014-10-09T14:18:44Z kuribas quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-09T14:19:16Z kuribas joined #scheme 2014-10-09T14:24:06Z Guest435 is now known as cam 2014-10-09T14:24:09Z cam quit (Changing host) 2014-10-09T14:24:09Z cam joined #scheme 2014-10-09T14:30:53Z taylanub: sethalves: same goes for Guile, yet the master branch uses CPS, so don't think that's relevant 2014-10-09T14:32:57Z stamourv: So does chicken, for that matter. 2014-10-09T14:41:19Z xinix quit (Quit: Leaving) 2014-10-09T14:44:02Z iterrogo joined #scheme 2014-10-09T14:44:04Z sethalves: well, they have ffi's, but I don't think you can use chicken to make a library which you can then link into a C++ program. 2014-10-09T14:45:22Z taylanub: I'm not sure about Chicken but Guile's C integration is very tight. it also uses a conservative GC for that reason, for example. 2014-10-09T14:52:00Z sethalves: I'm no expert in implementing schemes, I simply offer: perhaps bigloo doesn't use cps because the author wanted to match C calling convention 2014-10-09T14:52:21Z vanila: I have a quote to share 2014-10-09T14:52:29Z vanila: from Olin Shivers 2014-10-09T14:52:33Z kuribas quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-09T14:53:18Z vanila: http://lpaste.net/112374 2014-10-09T14:58:39Z weinholt quit (Ping timeout: 244 seconds) 2014-10-09T14:59:32Z weinholt joined #scheme 2014-10-09T15:00:22Z samth: vanila: note that not everyone agrees with that 2014-10-09T15:01:48Z gravicappa quit (Remote host closed the connection) 2014-10-09T15:02:10Z vanila: oh? 2014-10-09T15:08:57Z c107 joined #scheme 2014-10-09T15:10:38Z jusss quit (Remote host closed the connection) 2014-10-09T15:14:00Z vanila: huh ok 2014-10-09T15:14:44Z _tca: samth: what's an opposing view? 2014-10-09T15:16:14Z samth: _tca: that CPS makes things harder and requires re-extracting the different kinds of control flow, that other intermediate forms like ANF or SSA provide almost all the benefits, etc 2014-10-09T15:17:04Z vanila: samth, ANF is equivalent to CPS see Amr Sabrys paper 2014-10-09T15:17:14Z vanila: samth, and all this information can be recovered by CFA 2014-10-09T15:17:30Z samth: vanila: amr has the office down the hall from me, i know that paper 2014-10-09T15:17:34Z samth: and that isn't what it says 2014-10-09T15:17:39Z vanila: great! then you should already know this! 2014-10-09T15:19:58Z samth: vanila: what i said is precisely the argument of the PLDI 93 paper by flanagan et al 2014-10-09T15:21:01Z pnkfelix quit (Ping timeout: 272 seconds) 2014-10-09T15:21:31Z DGASAU quit (Remote host closed the connection) 2014-10-09T15:23:22Z DGASAU joined #scheme 2014-10-09T15:23:56Z theseb joined #scheme 2014-10-09T15:27:50Z c107 quit (Remote host closed the connection) 2014-10-09T15:28:20Z vanila: samth, when I read this paper what I got from it was that ANF lets you do compile equally well as CPS - they hint at ANF being better for organization but that doesn't seem to mean anything. There is an "un-CPS" arrow in their diagram but you still have higher order functions to deal with in control flow analysis so I can't see a particular advantage 2014-10-09T15:28:27Z MichaelRaskin joined #scheme 2014-10-09T15:28:58Z mornfall quit (Ping timeout: 272 seconds) 2014-10-09T15:31:49Z stamourv: vanila: http://mlton.org/pipermail/mlton/2003-January/023054.html 2014-10-09T15:32:23Z stamourv: Stephen Weeks has also written more on the subject. 2014-10-09T15:33:04Z stamourv: And he's one of the top functional compilers people, so I'd trust his judgement. 2014-10-09T15:34:38Z stamourv: vanila: Here's another one: http://www.mlton.org/pipermail/mlton/2003-March/023325.html 2014-10-09T15:35:06Z vanila: stamourv, thank you - reading 2014-10-09T15:42:48Z tadni quit (Ping timeout: 260 seconds) 2014-10-09T15:43:09Z vanila: His main point against CPS in favor of SSA in the first article seems to be that optimizations producing CPS are more difficult - I can see that, transformations on CPS code have to be very careful not to break the CPS condition 2014-10-09T15:48:19Z stamourv: Right, that and SSA makes more info explicit, which again makes optimization easier. 2014-10-09T15:48:52Z stamourv: So, if you're building a compiler that does significant optimization (like MLton), then SSA is great, and CPS doesn't have that much to offer. 2014-10-09T15:49:28Z stamourv: Not only that, but by using SSA, you can reuse a lot of the heavy tech that the Fortran compiler people have developed since the late 80s, which is quite impressive. 2014-10-09T15:49:37Z alexei_ joined #scheme 2014-10-09T15:49:43Z vanila: ok, I see! Thanks 2014-10-09T15:57:14Z vanila: from the second link I understand that he's saying SSA is more flexible since you don't have to be well scoped etc. that's something like 'type checking' that can be done later 2014-10-09T15:57:35Z vanila: so when you're performing complex optimizations you don't have to worry about scope issue 2014-10-09T16:01:31Z stamourv: Right, which allows you to do more optimizations. 2014-10-09T16:01:47Z stamourv: As long as you get domination right, you're good. 2014-10-09T16:04:17Z mornfall joined #scheme 2014-10-09T16:10:50Z mutley89 joined #scheme 2014-10-09T16:21:49Z alexei_ quit (Ping timeout: 272 seconds) 2014-10-09T16:22:52Z fridim_ quit (Ping timeout: 240 seconds) 2014-10-09T16:25:06Z alexei_ joined #scheme 2014-10-09T16:29:05Z fikusz quit (Ping timeout: 260 seconds) 2014-10-09T16:31:53Z lrs: (define (list? lst) 2014-10-09T16:31:53Z lrs: (if (pair? lst) if(list? (cdr list)) #f))) 2014-10-09T16:32:07Z lrs: Can someone please explain (in words) what this does 2014-10-09T16:32:43Z LeoNerd: Which bit confuses you? 2014-10-09T16:32:52Z lrs: (if (pair? lst) if(list? (cdr list)) #f))) 2014-10-09T16:32:58Z lrs: if lst is a pair 2014-10-09T16:33:01Z lrs: then... 2014-10-09T16:33:02Z lrs: ? 2014-10-09T16:33:08Z LeoNerd: That looks like a typo... that bare 'if' there 2014-10-09T16:33:20Z lrs: The second if? 2014-10-09T16:33:28Z LeoNerd: Are you sure you don't mean (if (pair? lst) (if (list? ... hangon no I'm not even sure what you could mean 2014-10-09T16:33:49Z lrs: It works. 2014-10-09T16:33:51Z alexei_ quit (Ping timeout: 272 seconds) 2014-10-09T16:33:58Z lrs: Its a function that cehcks if a lst i a list or not 2014-10-09T16:35:07Z przl quit (Ping timeout: 272 seconds) 2014-10-09T16:35:46Z Beluki joined #scheme 2014-10-09T16:42:27Z fikusz joined #scheme 2014-10-09T16:47:55Z civodul joined #scheme 2014-10-09T16:53:11Z lrs: LeoNerd, 2014-10-09T16:55:23Z mornfall quit (Ping timeout: 272 seconds) 2014-10-09T16:55:26Z LeoNerd: Mm? 2014-10-09T16:57:33Z lrs: LeoNerd, Can you help me 2014-10-09T16:57:35Z lrs: Do it right 2014-10-09T16:57:35Z lrs: :S 2014-10-09T16:57:49Z LeoNerd: I don't follow the existing code. It is a syntax error 2014-10-09T16:57:53Z mornfall joined #scheme 2014-10-09T16:57:54Z LeoNerd: That silly if(...) 2014-10-09T16:58:09Z lrs: (define (list? lst) 2014-10-09T16:58:09Z lrs: (if (pair? lst) (list? (cdr list)) #f)) 2014-10-09T16:58:23Z LeoNerd: Right; that looks much better 2014-10-09T16:58:38Z LeoNerd: So, which part is now confusing you? 2014-10-09T16:58:38Z vanila: (define (list? l) (or (null? l) (and (pair? l) (list? (cdr l))))) 2014-10-09T16:59:03Z vanila: A list is either null, or a pair whose cdr is a list 2014-10-09T17:00:15Z lrs: Maybe I should ask 2014-10-09T17:00:18Z lrs: When is it true 2014-10-09T17:00:49Z lrs: A list is atleast a pair of numbers right 2014-10-09T17:00:51Z lrs: If I do list 1 2014-10-09T17:00:52Z lrs: Its 2014-10-09T17:01:23Z lrs: (1 . nil) 2014-10-09T17:01:39Z lrs: Does it do pair on 1 2014-10-09T17:01:41Z lrs: and then pair on nil 2014-10-09T17:01:42Z lrs: Or what 2014-10-09T17:03:15Z _tca: (1 . nil) is a pair of 1 and nil 2014-10-09T17:03:50Z vanila: (a b c 1 2 3) is a list 2014-10-09T17:03:53Z _tca: (1 . 2) is a pair of 1 and 2, and is not a list 2014-10-09T17:05:03Z _tca: (1 . (2 . nil)) is a pair of 1 and a pair of 2 and nil, and is a list 2014-10-09T17:11:43Z lrs: What is (list 1) 2014-10-09T17:12:17Z mornfall quit (Ping timeout: 245 seconds) 2014-10-09T17:18:21Z _tca: (list 1) is (1 . nil) is a pair of 1 and nil 2014-10-09T17:18:48Z _tca: (list 1 2) is (1 . (2 . nil)) is a pair of 1 and a pair of 2 and nil, and is a list 2014-10-09T17:19:15Z _tca: (1 . 2) cannot be made using list 2014-10-09T17:19:37Z lrs: So if my function 2014-10-09T17:19:40Z lrs: Needs a pair to work 2014-10-09T17:19:48Z lrs: Why does it give true to (list 1) 2014-10-09T17:19:55Z mornfall joined #scheme 2014-10-09T17:19:58Z lrs: If (list 1) is (1.nil) 2014-10-09T17:20:00Z lrs: Because it takes 2014-10-09T17:20:09Z lrs: 1 and what? 2014-10-09T17:20:13Z lrs: and then takes nil and what? 2014-10-09T17:20:21Z _tca: there is no and what 2014-10-09T17:20:31Z lrs: ? 2014-10-09T17:20:51Z _tca: (cons 1 nil) == (1 . nil) 2014-10-09T17:20:56Z lrs: Right 2014-10-09T17:21:14Z lrs: but it does two actions right 2014-10-09T17:21:22Z lrs: It does pair on 1 2014-10-09T17:21:24Z _tca: no 2014-10-09T17:21:30Z lrs: How does it work 2014-10-09T17:21:37Z _tca: how does what work 2014-10-09T17:21:51Z _tca: the procedure "pair?" ? 2014-10-09T17:21:57Z lrs: (pair? lst) (list? (cdr lst) 2014-10-09T17:22:23Z oleo is now known as Guest14836 2014-10-09T17:22:27Z lrs: Does it first take a pair of the first element? 2014-10-09T17:22:29Z _tca: pair? checks if it is a pair which is an atomic operation, something is either a pair or it isnt 2014-10-09T17:22:31Z lrs: And then does cdr? 2014-10-09T17:22:37Z _tca: no 2014-10-09T17:22:39Z lrs: im talking the operations it does 2014-10-09T17:23:06Z _tca: pair? is a primitive 2014-10-09T17:23:19Z _tca: it doesn't do anything on the elemnts of the pair 2014-10-09T17:23:59Z oleo__ joined #scheme 2014-10-09T17:24:15Z lrs: WHat is the first thing hte function does 2014-10-09T17:24:19Z _tca: it could be a completely invalid object that isn't a pair, but if it's tagged as a pair, pair? will return #t 2014-10-09T17:25:09Z _tca: lrs: it checks a type tag, that is the only thing it does 2014-10-09T17:25:18Z pnpuff joined #scheme 2014-10-09T17:25:19Z _tca: it's not something you can define as a user of scheme 2014-10-09T17:25:23Z lrs: I get that 2014-10-09T17:25:48Z lrs: Im talking about what it does on (cons 1(cons 2(cons 3(()'))) 2014-10-09T17:25:59Z _tca: pair? or list? 2014-10-09T17:26:01Z lrs: Whats the first thing it does 2014-10-09T17:26:10Z lrs: (pair? lst) < Thats the first thing it does, correct? 2014-10-09T17:26:25Z Guest14836 quit (Ping timeout: 272 seconds) 2014-10-09T17:27:05Z _tca: if you are talking about list? now, then yes 2014-10-09T17:27:12Z lrs: Yes 2014-10-09T17:27:27Z lrs: (cons 1(cons 2(cons 3(()'))) <- So what does that mean? 2014-10-09T17:27:38Z _tca: (list 1 2 3) 2014-10-09T17:28:19Z taylanub: (except the parantheses, apostrophe, and spacing are all wrong again) 2014-10-09T17:28:31Z taylanub: lrs: (cons 1 (cons 2 (cons 3 '()))) 2014-10-09T17:28:37Z psy joined #scheme 2014-10-09T17:29:03Z psy_ joined #scheme 2014-10-09T17:29:04Z taylanub: = (1 . (2 . (3 . ()))) 2014-10-09T17:29:07Z taylanub: = (1 2 3) 2014-10-09T17:29:19Z psy quit (Read error: Connection reset by peer) 2014-10-09T17:29:36Z _tca: also lrs that definition of list? you pasted above is wrong as vanila pointed out and gave the correct one 2014-10-09T17:29:50Z mario-goulart quit (Remote host closed the connection) 2014-10-09T17:29:56Z alexei_ joined #scheme 2014-10-09T17:32:22Z lrs: _tca, Why does he uses or and and 2014-10-09T17:33:12Z _tca: the saem reason you just used and to ask me that question 2014-10-09T17:33:59Z lrs: ? 2014-10-09T17:34:22Z wingo quit (Ping timeout: 240 seconds) 2014-10-09T17:34:30Z mario-goulart joined #scheme 2014-10-09T17:36:03Z kongtomorrow joined #scheme 2014-10-09T17:36:06Z vanila: lrs, 2014-10-09T17:36:13Z vanila: (and #t #t) ;=> #t 2014-10-09T17:36:16Z vanila: (and #t #f) ;=> #f 2014-10-09T17:36:19Z vanila: (and #f #t) ;=> #f 2014-10-09T17:36:22Z vanila: (and #f #f) ;=> #f 2014-10-09T17:36:37Z Beluki quit (Quit: Beluki) 2014-10-09T17:40:03Z _tca: lrs: for something to be a list: (it has to be nil) OR ((it has to be a pair) AND (it's cdr has to be a list)) 2014-10-09T17:40:36Z lrs: _tca: So what happens when you do list 1 2014-10-09T17:40:37Z vanila: (OR (it has to be nil) (AND (it has to be a pair) (it's cdr has to be a list))) <--- in lisp notation 2014-10-09T17:41:12Z _tca: lrs: it produces a pair of 1 and nil 2014-10-09T17:41:24Z _tca: did you mean what happens when you do (list? 1) ? 2014-10-09T17:41:37Z lrs: Yes 2014-10-09T17:42:08Z _tca: it check if it's null? then that fails, then it checks if it's a pair? and that returns false 2014-10-09T17:42:24Z _tca: then it terminates returning false to you 2014-10-09T17:45:33Z lrs: Ok 2014-10-09T17:46:32Z lrs: _tca, Then why do I need to do cdr 2014-10-09T17:46:34Z lrs: Exactly 2014-10-09T17:46:51Z lrs: I mean, its only when it is like you just said _tca that it wont be a list 2014-10-09T17:46:51Z _tca: you don't in this case 2014-10-09T17:46:55Z _tca: checking that it's a pair is a prerequisite to inspecting it's cdr because _ONLY_ pairs have cdrs, if you try to (cdr 1) you will get an error 2014-10-09T17:47:04Z _tca: it never reaches that part 2014-10-09T17:47:20Z lrs: So I dont need (list? (cdr l)) or what 2014-10-09T17:47:22Z _tca: the reason you need to do cdr is in case it _IS_ a pair 2014-10-09T17:47:27Z _tca: you do 2014-10-09T17:47:40Z _tca: (1 . (2 . 3)) is not a list, is why 2014-10-09T17:47:49Z lrs: ? 2014-10-09T17:47:54Z lrs: (pair? l) 2014-10-09T17:48:01Z kazimir42 joined #scheme 2014-10-09T17:48:02Z _tca: (1 . (2 . (3 . ()))) is a list 2014-10-09T17:48:03Z lrs: It checks if 1 and (2.3) is a pair 2014-10-09T17:48:05Z lrs: Which is true 2014-10-09T17:48:11Z lrs: THen it goes to the 2014-10-09T17:48:21Z lrs: (list? (cdr l)) 2014-10-09T17:48:24Z lrs: Which means it takes 2014-10-09T17:48:26Z _tca: yep 2014-10-09T17:48:27Z lrs: (2.3) 2014-10-09T17:48:30Z _tca: it takes (list? 3) 2014-10-09T17:48:32Z lrs: And checks if thats a pair? 2014-10-09T17:48:44Z _tca: oh yes youa re right im a step ahead 2014-10-09T17:48:55Z _tca: and then it checkes (list? 3) after that 2014-10-09T17:49:02Z _tca: which returns false 2014-10-09T17:49:05Z lrs: Right 2014-10-09T17:49:22Z alexei_ quit (Ping timeout: 240 seconds) 2014-10-09T17:49:27Z wingo joined #scheme 2014-10-09T17:49:36Z _tca: checking if something is a list requires you following it all the way to the end 2014-10-09T17:49:48Z lrs: The end is ()' 2014-10-09T17:49:56Z lrs: And list automatically creates that one 2014-10-09T17:50:02Z lrs: but If I write what you wrote, its not a list 2014-10-09T17:50:29Z _tca: yep 2014-10-09T17:51:07Z lrs: So (list 1 2) 2014-10-09T17:51:08Z lrs: Is 2014-10-09T17:51:17Z lrs: (1(2.()')) 2014-10-09T17:51:23Z lrs: So it starts 2014-10-09T17:51:31Z lrs: 1 and pair (2.()' 2014-10-09T17:51:37Z lrs: And then it goes to the next 2014-10-09T17:51:47Z lrs: (2.()') which is true 2014-10-09T17:51:50Z lrs: And then it stops 2014-10-09T17:51:53Z lrs: Or am I dumb? 2014-10-09T17:51:55Z developernotes quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2014-10-09T17:52:04Z vanila: lrs, I think it should be '() instead of ()' 2014-10-09T17:52:07Z lrs: Right 2014-10-09T17:52:09Z vanila: also 2. is one thing, you need spacse 2014-10-09T17:52:09Z taylanub: lrs: )(*!@&#! get your parentheses and whitespace right at last! 2014-10-09T17:52:12Z vanila: (2 . ()) 2014-10-09T17:52:54Z vanila: (2 . '()) 2014-10-09T17:52:54Z lrs: Thats the last thing it does 2014-10-09T17:53:06Z vanila: (list 1 2) 2014-10-09T17:53:07Z vanila: is equal to 2014-10-09T17:53:13Z vanila: (cons 1 (cons 2 '())) 2014-10-09T17:53:16Z vanila: and it's the same as 2014-10-09T17:53:18Z lrs: Yesss 2014-10-09T17:53:21Z vanila: '(1 . (2 . ())) 2014-10-09T17:54:31Z lrs: Do you see what i am saying 2014-10-09T17:54:48Z lrs: If a list automatically has a ()' 2014-10-09T17:54:55Z lrs: Do I really need to go down to 2014-10-09T17:54:59Z pnpuff quit (Quit: Lost terminal) 2014-10-09T17:55:00Z lrs: '() with the cdr 2014-10-09T17:55:31Z vanila: i don't know what you mean 2014-10-09T17:55:54Z lrs: (1 . (2 . 3)) < Not a list 2014-10-09T17:56:05Z lrs: (1(2.()')) 2014-10-09T17:56:08Z lrs: ^list 2014-10-09T17:56:20Z vanila: you're right that (1 . (2 . 3)) is not a list 2014-10-09T17:56:24Z vanila: it's the same as (1 2 . 3) 2014-10-09T17:56:29Z vanila: it's improper 2014-10-09T17:56:41Z vanila: (1(2.()')) 2014-10-09T17:56:43Z vanila: looks wrong 2014-10-09T17:56:44Z lrs: Or rather, when is it not a list? 2014-10-09T17:56:49Z vanila: I think you mean '() instead of ()' 2014-10-09T17:56:58Z vanila: and you made the 2. mistake again 2014-10-09T17:57:03Z vanila: you should write (2 . '()) 2014-10-09T17:57:04Z lrs: (1 . (2 . '())) 2014-10-09T17:57:08Z vanila: that is a list 2014-10-09T17:57:14Z lrs: (1 . (2 . 3)) 2014-10-09T17:57:18Z lrs: Not a list 2014-10-09T17:57:18Z vanila: that's what (list 1 2) builds 2014-10-09T17:57:34Z vanila: yeah , that's right ! 2014-10-09T17:58:56Z lrs: Hmm 2014-10-09T17:59:20Z lrs: I wa thinking that you would only need to check hte first pair if its a list or something.. 2014-10-09T17:59:30Z lrs: Is (1. '()) 2014-10-09T17:59:32Z lrs: A list? 2014-10-09T17:59:40Z vanila: did you mean (1 . '()) ? 2014-10-09T17:59:50Z lrs: Yes 2014-10-09T17:59:54Z vanila: that's a list, yeah 2014-10-09T18:00:00Z vanila: because it's a pair, with the CDR a list 2014-10-09T18:00:21Z lrs: First it check if its a pair 2014-10-09T18:00:25Z lrs: Which is true 2014-10-09T18:00:27Z kongtomorrow quit 2014-10-09T18:00:28Z lrs: And then it does the cdr 2014-10-09T18:00:34Z lrs: And does that mean it just takes null or what 2014-10-09T18:00:37Z vanila: yes, good but also remember 2014-10-09T18:00:39Z vanila: '() is a list 2014-10-09T18:00:46Z vanila: (list) creates it 2014-10-09T18:01:23Z lrs: And it gives true 2014-10-09T18:01:28Z _tca: yep 2014-10-09T18:03:52Z lrs: Can I discuss another function I did 2014-10-09T18:04:09Z lrs: (define (next-highest l) 2014-10-09T18:04:09Z lrs: (cond ((null? (cdr l)) (car l)) 2014-10-09T18:04:10Z lrs: (else (cadr (sort l >))))) 2014-10-09T18:05:01Z bpalmer left #scheme 2014-10-09T18:11:47Z taylanub: note that you can just (define (next-highest l) (cadr (sort l >))) as well 2014-10-09T18:12:18Z taylanub: checking (null? (cdr l)) is just testing if the list has one element. sorting a list of one element is fine; it will just return the same list as-is 2014-10-09T18:14:53Z lrs: cannot reference undefined identifier 2014-10-09T18:14:57Z lrs: It gives me 2014-10-09T18:15:18Z atomx_ joined #scheme 2014-10-09T18:16:40Z leppie quit 2014-10-09T18:16:48Z atomx quit (Ping timeout: 260 seconds) 2014-10-09T18:18:37Z leppie joined #scheme 2014-10-09T18:19:01Z developernotes joined #scheme 2014-10-09T18:21:49Z alexei_ joined #scheme 2014-10-09T18:27:24Z HisaoNakai joined #scheme 2014-10-09T18:27:31Z HisaoNakai: o/ 2014-10-09T18:28:08Z lrs: taylanub, How would you describe that function 2014-10-09T18:29:27Z HisaoNakai: Is there anything like Guile-XCB for someone who wants to use, say, Gambit? 2014-10-09T18:29:58Z theseb: speaking of guile....anyone still going gaga over the guile-emacs port? 2014-10-09T18:30:07Z hiroakip joined #scheme 2014-10-09T18:33:09Z HisaoNakai: (I can't believe someone wants to use freaking XML for anything) 2014-10-09T18:36:13Z theseb: oh say..i'm not saying i agree but i thought of ONE *possible* advantage of XML of sexprs......with sexprs you don't know which closing quote goes with what list.....with XML you do know since closing goo is labelled..e.g. or , etc. 2014-10-09T18:37:09Z HisaoNakai: oh, looks like I misunderstood the role of XML in XCB 2014-10-09T18:38:33Z HisaoNakai: ...or, I didn't. 2014-10-09T18:38:39Z daviid joined #scheme 2014-10-09T18:39:17Z taylanub: lrs: ? 2014-10-09T18:40:32Z taylanub: lrs: given you have 'sort' in your environment, that definition should work just fine. after having executed that definition, you can call the function on any list of numbers (objects accepted by the procedure '>', to be exact) 2014-10-09T18:43:02Z sheilong joined #scheme 2014-10-09T18:48:32Z HisaoNakai: Anyone? :s 2014-10-09T18:49:00Z lrs: taylanub, (null? (cdr l)) (car l)) please explain the cdr and car here 2014-10-09T18:49:02Z lrs: And cadr 2014-10-09T18:50:13Z gravicappa joined #scheme 2014-10-09T18:52:15Z _tca: HisaoNakai: I doubt it not many people use gambit 2014-10-09T18:52:36Z HisaoNakai: _tca: and, say, Chicken Scheme? 2014-10-09T18:53:10Z _tca: Just search in eggs then 2014-10-09T18:54:40Z HisaoNakai: Only xlib. Hrm... 2014-10-09T18:55:55Z _tca: guile has always been good with bindings being available 2014-10-09T18:59:07Z c107 joined #scheme 2014-10-09T19:01:30Z lrs: (cond ((null? (cdr l)) (car l)) 2014-10-09T19:01:30Z lrs: (else (cadr (sort l >))))) 2014-10-09T19:01:32Z lrs: Does it mean 2014-10-09T19:01:46Z lrs: If the cdr of l is 0, give car of l 2014-10-09T19:02:07Z lrs: and then use car l on (cadr (sort l >) 2014-10-09T19:02:19Z lrs: Does it carry car to the else line 2014-10-09T19:03:47Z turbofail: no, it doesn't carry anything to the else line 2014-10-09T19:04:28Z turbofail: what it's saying is, if (cdr l) is empty, then return (car l), else return the second element of the sorted list 2014-10-09T19:05:28Z lrs: Why car l 2014-10-09T19:05:43Z turbofail: well i just got here so i don't know exactly what's going on 2014-10-09T19:06:05Z turbofail: but my guess is that if (cdr l) is null, there's only one element in the list 2014-10-09T19:06:32Z turbofail: and as such, the only thing that makes sense to grab is (car l) 2014-10-09T19:06:34Z pjb: lrs: null? doesn't test for zero, it tests for the empty list (). 2014-10-09T19:07:07Z lrs: Right 2014-10-09T19:07:11Z lrs: But why do I need car 2014-10-09T19:07:17Z lrs: Why not just null? lst 2014-10-09T19:07:17Z pjb: lrs: this code fails when the list l is empty. (sort () >) returns (), and (cadr '()) is an error. 2014-10-09T19:07:25Z lrs: I get that 2014-10-09T19:07:32Z lrs: but why do I need car l as the #f 2014-10-09T19:07:41Z BW^- joined #scheme 2014-10-09T19:07:41Z turbofail: that's not the #f 2014-10-09T19:07:50Z turbofail: do you know how cond works? 2014-10-09T19:07:51Z BW^-: in the numeric tower, what is the exact unique word to describe values like 1111111111/2222222 ? 2014-10-09T19:07:58Z lrs: Yeah 2014-10-09T19:07:59Z lrs: I mean 2014-10-09T19:08:01Z BW^-: i.e., a value consisting of two integers with a divisor betwen 2014-10-09T19:08:02Z lrs: The thing it does 2014-10-09T19:08:07Z lrs: If null? is true 2014-10-09T19:08:24Z turbofail: why wouldn't you need car? 2014-10-09T19:08:45Z turbofail: you're trying to find the next-highest element. if there's only one element in the list, what else are you going to return? 2014-10-09T19:08:52Z pjb: I lack context to answer why l is list and why when it's a signeton, it should return the element, but when it's not a singleton or empty list, it should return the second biggest element. 2014-10-09T19:08:56Z lrs: turbofail 2014-10-09T19:09:01Z lrs: Lets say i have 2014-10-09T19:09:11Z lrs: (list '() 2 3 4 5) 2014-10-09T19:09:16Z turbofail: wat 2014-10-09T19:09:40Z pjb: ah, it's next-highest. 2014-10-09T19:09:44Z turbofail: what is that null doing there? 2014-10-09T19:09:52Z pjb: So you need car, because next-highest must return an element, not a list. 2014-10-09T19:10:00Z lrs: Hm 2014-10-09T19:10:09Z pjb: (next-highest '()) fails. 2014-10-09T19:10:22Z DGASAU quit (Ping timeout: 240 seconds) 2014-10-09T19:10:23Z pjb: (next-highest '(1)) returns 1 (hence the (car l)). 2014-10-09T19:10:27Z turbofail: if you have that list and pass it to that function, it'll also fail because you can't sort a list of numbers that has a null in it 2014-10-09T19:10:39Z pjb: (next-highest '(1 2 3)) returns 2 (hence the (cadr (sort …))). 2014-10-09T19:10:40Z przl joined #scheme 2014-10-09T19:10:42Z turbofail: it'll try and compare '() to a number 2014-10-09T19:12:32Z daviid quit (Ping timeout: 272 seconds) 2014-10-09T19:12:55Z turbofail: on an unrelated note, this is one of those places where i feel like pattern matching should be the preferred introductory approach 2014-10-09T19:13:15Z turbofail: or perhaps the only approach 2014-10-09T19:13:47Z BW^-: anyone? 2014-10-09T19:13:58Z BW^-: in the numeric tower, what is the exact unique word to describe values like 1111111111/2222222 ? 2014-10-09T19:14:04Z lrs: Heres the thing I guess 2014-10-09T19:14:05Z turbofail: BW^-: a rational number 2014-10-09T19:14:07Z BW^-: it's not "exact" because fixnums qualify as that too 2014-10-09T19:14:10Z lrs: If it finds that list is null 2014-10-09T19:14:17Z lrs: It prints out car ? 2014-10-09T19:14:18Z BW^-: turbofail: but.. flonums are rationals too!!!!!!!!!!!!! 2014-10-09T19:14:22Z BW^-: at least in Gambit! 2014-10-09T19:14:23Z turbofail: BW^-: they just call them exact rationals 2014-10-09T19:14:28Z BW^-: aha 2014-10-09T19:14:29Z DGASAU joined #scheme 2014-10-09T19:14:36Z BW^-: ok 2014-10-09T19:14:37Z turbofail: flonums are inexact rationals 2014-10-09T19:14:42Z BW^-: turbofail: so "exact rational" that's what you call them 2014-10-09T19:14:50Z BW^-: turbofail: is there any individual typecheck for exact rational? 2014-10-09T19:14:55Z turbofail: lrs: it doesn't print out anything, it just returns it 2014-10-09T19:14:58Z BW^-: |exact-rational?|? :) 2014-10-09T19:15:01Z lrs: Yeah 2014-10-09T19:15:05Z lrs: It returns car l 2014-10-09T19:15:09Z lrs: But I dont get it 2014-10-09T19:15:12Z lrs: Why car? 2014-10-09T19:15:17Z lrs: If the list is null, its null 2014-10-09T19:15:20Z lrs: Nothing 2014-10-09T19:15:29Z turbofail: it's not finding that the LIST is null, it's finding that the CDR of the list is null 2014-10-09T19:15:31Z turbofail: (cdr l) is not l 2014-10-09T19:15:59Z wingo quit (Ping timeout: 272 seconds) 2014-10-09T19:16:23Z lrs: Right 2014-10-09T19:16:27Z turbofail: if you construct a list using (define my-list (list 1)), then (car my-list) is 1, and (cdr my-list) is null 2014-10-09T19:16:33Z lrs: So if list (()' 2 3 4) 2014-10-09T19:16:37Z lrs: THen it will do car 2014-10-09T19:16:55Z lrs: It will do 2 3 4 2014-10-09T19:17:32Z turbofail: yes 2014-10-09T19:17:44Z lrs: Why? 2014-10-09T19:17:50Z turbofail: except that syntax you gave doesn't make sense 2014-10-09T19:17:52Z lrs: I mean whats the purpose in the next-highest thing 2014-10-09T19:18:09Z turbofail: wait what? do you know what car and cdr do? 2014-10-09T19:18:12Z lrs: (list ('() 2 3 4)) 2014-10-09T19:18:14Z lrs: Yes 2014-10-09T19:18:16Z turbofail: rudybot: (car (list 1 2 3 4)) 2014-10-09T19:18:17Z rudybot: turbofail: your sandbox is ready 2014-10-09T19:18:17Z rudybot: turbofail: ; Value: 1 2014-10-09T19:18:34Z lrs: Ops 2014-10-09T19:18:38Z lrs: So if 2014-10-09T19:18:46Z turbofail: rudybot: (null? (cdr (list 1))) 2014-10-09T19:18:46Z rudybot: turbofail: ; Value: #t 2014-10-09T19:18:55Z turbofail: rudybot: (car (list 1)) 2014-10-09T19:18:55Z rudybot: turbofail: ; Value: 1 2014-10-09T19:19:00Z turbofail: that's exactly what we're doing here 2014-10-09T19:19:02Z BW^- quit (Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org) 2014-10-09T19:19:09Z lrs: rudybot: (null? (cdr (list 1 2 3 '() 1))) 2014-10-09T19:19:09Z rudybot: lrs: your sandbox is ready 2014-10-09T19:19:10Z rudybot: lrs: ; Value: #f 2014-10-09T19:20:17Z turbofail: rudybot: (cdr (list 1 2 3)) 2014-10-09T19:20:17Z rudybot: turbofail: ; Value: '(2 3) 2014-10-09T19:20:25Z lrs: I mixed cdr up 2014-10-09T19:20:27Z lrs: But 2014-10-09T19:20:32Z turbofail: rudybot: (null? (list '())) 2014-10-09T19:20:32Z rudybot: turbofail: ; Value: #f 2014-10-09T19:20:39Z lrs: It checks if cdr of l is null? 2014-10-09T19:20:45Z lrs: Any of it is null? 2014-10-09T19:20:52Z turbofail: you seem to be confused about the difference between having a null in the cdr of a pair, and a null in the car of a pair 2014-10-09T19:21:00Z lrs: No 2014-10-09T19:21:12Z turbofail: are you sure? because you keep sticking nulls in the middle of your list 2014-10-09T19:21:19Z lrs: I am trying to figure out the loop 2014-10-09T19:21:24Z turbofail: which doesn't make sense in the context of this problem 2014-10-09T19:21:40Z lrs: First it checks if the rest of the list is null 2014-10-09T19:21:44Z turbofail: yes 2014-10-09T19:21:55Z lrs: If that is true it does car l 2014-10-09T19:21:58Z turbofail: yes 2014-10-09T19:22:31Z lrs: Then it goes and does cadr, which is the second item ? or something 2014-10-09T19:22:40Z pjb: lrs: if the list was empty, cdr would signal an error. 2014-10-09T19:22:45Z turbofail: it only does that if the rest of the list is not null 2014-10-09T19:22:56Z lrs: What if it is 2014-10-09T19:22:58Z pjb: lrs: car and cdr only work on pairs. () is not a pair. It's an empty list. 2014-10-09T19:23:00Z lrs: What if cdr is 2014-10-09T19:23:04Z daviid joined #scheme 2014-10-09T19:23:05Z turbofail: is what? 2014-10-09T19:23:09Z lrs: '() 2 3 '() 3 2014-10-09T19:23:16Z lrs: And it does the loop 2014-10-09T19:23:18Z turbofail: what does that even mean? 2014-10-09T19:23:35Z lrs: or wait, it doesnt call the function 2014-10-09T19:23:39Z turbofail: first of all there isn't even a loop 2014-10-09T19:23:48Z _tca: lrs: for "null?" ? 2014-10-09T19:24:13Z lrs: What if the first is '() 2014-10-09T19:24:20Z turbofail: then it's an error 2014-10-09T19:24:23Z pjb: then an error is signaled by < called by sort. 2014-10-09T19:24:40Z pjb: Unless it's alone: (next-higest '(())) --> () 2014-10-09T19:24:42Z turbofail: there shouldn't be any nulls in the car of the list 2014-10-09T19:25:00Z turbofail: well yes, a list with a single null would work 2014-10-09T19:25:02Z turbofail: as given 2014-10-09T19:26:48Z Sgeo_ joined #scheme 2014-10-09T19:27:37Z didi joined #scheme 2014-10-09T19:27:44Z _tca: lrs: the check for cdr being null is esentiall asking if the list which has been sorted only has one element in it 2014-10-09T19:28:16Z lrs: Right 2014-10-09T19:28:20Z _tca: (cond ((null? (cdr l)) (car l)) ...) could be (cond ((= (length l) 1) (car l)) ...) 2014-10-09T19:29:01Z lrs: Otherwise it takes the second item in the list right 2014-10-09T19:29:05Z lrs: Or how does cadr work 2014-10-09T19:29:08Z _tca: yea 2014-10-09T19:29:11Z _tca: cadr is second 2014-10-09T19:29:18Z _tca: you can also use (second x) instead of (cadr x) 2014-10-09T19:29:35Z lrs: rudyboy: cadr (1.(2.(3.'()))) 2014-10-09T19:29:53Z lrs: It does car two times or something 2014-10-09T19:29:54Z Sgeo quit (Ping timeout: 244 seconds) 2014-10-09T19:30:05Z turbofail: no, it does (car (cdr l)) 2014-10-09T19:30:08Z _tca: ^ 2014-10-09T19:30:25Z lrs: Does it irst pick 1 2014-10-09T19:30:29Z pjb: lrs: you need to use spaces to separate most tokens in lisp. 2014-10-09T19:30:33Z lrs: (1 paired with 2.(3.'()))) 2014-10-09T19:30:38Z lrs: And take 2 of the pair 1 or something 2014-10-09T19:30:41Z pjb: rudybot: (cadr (1 . (2 . (3 . '())))) 2014-10-09T19:30:41Z rudybot: pjb: your sandbox is ready 2014-10-09T19:30:41Z rudybot: pjb: error: eval:1:21: quote: bad syntax in: quote 2014-10-09T19:30:43Z _tca: no 2014-10-09T19:30:48Z _tca: cadr never sees the one 2014-10-09T19:30:55Z pjb: rudybot: (cadr '(1 . (2 . (3 . '()))))a 2014-10-09T19:30:56Z rudybot: pjb: and obviously it could be smarter, because cadr wants a pair whose cdr is also a pair 2014-10-09T19:31:09Z _tca: looking at the 1 could make your runtime crash and (cadr '(1 2 3)) wouoldn't crash 2014-10-09T19:31:34Z lrs: car of '(1 . (2 . (3 . '())))) is 1 2014-10-09T19:31:45Z _tca: the pair is a container which holds 2 thins, it doesn't attach things to each other 2014-10-09T19:31:50Z lrs: So it takes into '(1 . 2014-10-09T19:31:54Z turbofail: lrs: it literally does (car (cdr l)), i.e. take (cdr l) and then call (car <>) on that 2014-10-09T19:31:56Z _tca: nope 2014-10-09T19:31:58Z lrs: Then it says cadr 2014-10-09T19:32:03Z lrs: I mean cdr 2014-10-09T19:32:08Z lrs: :S 2014-10-09T19:32:15Z _tca: youa re thinking like its attached by the . 2014-10-09T19:32:18Z _tca: a pair is a container 2014-10-09T19:32:20Z _tca: with a car and a cdr 2014-10-09T19:32:26Z _tca: like a 2 element vector 2014-10-09T19:32:28Z lrs: Ok so car l means it just opens the container 2014-10-09T19:32:35Z lrs: And takes the first element or what 2014-10-09T19:32:40Z _tca: pair[0] = car ; pair[1] = cdr 2014-10-09T19:32:44Z lrs: car picks 1 . 2+ rest 2014-10-09T19:32:47Z lrs: and then cdr 2014-10-09T19:32:48Z pjb: yes, and close the container when done. 2014-10-09T19:32:51Z lrs: Takes 2+ rest 2014-10-09T19:33:00Z turbofail: lrs: it does the cdr operation first 2014-10-09T19:33:04Z pjb: Don't forget to close the containers when you've opened them. 2014-10-09T19:33:06Z lrs: Oh 2014-10-09T19:33:13Z lrs: So it takes the cdr 2014-10-09T19:33:20Z lrs: And the first element in cdr 2014-10-09T19:33:22Z lrs: That makes sense 2014-10-09T19:33:24Z _tca: yes 2014-10-09T19:33:28Z turbofail: lrs: that's how evaluation works, as we've described to you many times before 2014-10-09T19:33:54Z turbofail: lrs: (f (g x)) does (g x) first, and then calls (f ...) on that 2014-10-09T19:34:19Z lrs: Right 2014-10-09T19:35:06Z _tca: turbofail: i think he was just confused about how cons works thinking that you start by looking at the head object then looking for something attached to it 2014-10-09T19:35:36Z turbofail: _tca: well there was clearly some confusion about evaluation order 2014-10-09T19:35:40Z lrs: No I thought it started 2014-10-09T19:35:52Z Riastradh joined #scheme 2014-10-09T19:35:56Z lrs: With car and then cdr 2014-10-09T19:36:04Z lrs: Atleast this time 2014-10-09T19:36:17Z HisaoNakai: Should a person new to Scheme learn R6RS, or R5RS? 2014-10-09T19:36:49Z turbofail: HisaoNakai: i imagine that would depend on why they're learning it and what they're intending to do 2014-10-09T19:36:54Z lewis1711 joined #scheme 2014-10-09T19:37:53Z HisaoNakai: turbofail: Android development using Chicken/Gambit 2014-10-09T19:38:02Z pjb: HisaoNakai: skip r6rs. Lean r5rs because it's only 50 pages, and then r7rs. 2014-10-09T19:38:14Z _tca: chicken/gambit are both focused r5rs 2014-10-09T19:39:14Z turbofail: r6rs is a good standard, but chicken and gambit basically ignore it 2014-10-09T19:39:20Z turbofail: basically everybody but racket ignores it 2014-10-09T19:39:28Z HisaoNakai: lol 2014-10-09T19:39:36Z HisaoNakai: But will Scheme stay minimal? O.o 2014-10-09T19:40:03Z turbofail: minimal is only useful for research papers. and r5rs isn't even really minimal enough for those 2014-10-09T19:40:13Z turbofail: it's a silly criteria for judging a standard 2014-10-09T19:40:26Z HisaoNakai: hrm 2014-10-09T19:40:26Z HisaoNakai: 2014-10-09T19:42:10Z gnomon: 2014-10-09T19:42:16Z HisaoNakai: it seems backwards, because you have CL for the complicated (Howl's Moving Castle)...why send Scheme the same way o.O 2014-10-09T19:42:21Z przl quit (Ping timeout: 246 seconds) 2014-10-09T19:42:39Z turbofail: HisaoNakai: because you can't get anything done with a minimal standard 2014-10-09T19:42:48Z turbofail: it's totally fucking useless 2014-10-09T19:43:42Z gnomon: turbofail, I disagree, but in a respectful and non-challenging way. 2014-10-09T19:43:46Z _tca: HisaoNakai: because if it's too minimal you get fragmentation with implementations adding things they need to make programming nice 2014-10-09T19:43:59Z _tca: for example module systems with r5rs schemes 2014-10-09T19:44:16Z _tca: and procedural macro systems for when syntax-rules doesn't suffice 2014-10-09T19:44:43Z HisaoNakai: _tca: I'm a newb to programming, so maybe this is preposterous of me to say, but - libraries? O_o 2014-10-09T19:45:00Z _tca: HisaoNakai: thats the problem the libraries simply aren't portable 2014-10-09T19:45:04Z turbofail: yeah, module systems, error handling, macro systems, etc. 2014-10-09T19:45:20Z _tca: theres lots of things where direct implementation support is needed 2014-10-09T19:45:39Z turbofail: disjoint types 2014-10-09T19:45:42Z _tca: HisaoNakai: as you learn more scheme you will witness yourself the fragmentation 2014-10-09T19:45:48Z HisaoNakai: hrm... 2014-10-09T19:45:49Z HisaoNakai: 2014-10-09T19:46:58Z turbofail: then of course there's the actual libraries needed to get work done, i.e. networking, filesystem interaction, binary I/O... 2014-10-09T19:47:12Z turbofail: the standard has none of that 2014-10-09T19:47:27Z gnomon: HisaoNakai, that's what the SRFI process is for: it encompasses not just libraries built directly atop the standard, but also extensions to the standard to incorporate implementation-specific details. The intention is for the SRFI process to allow implementations to publish their extensions, allow them to be used and shaken out, and then to take those into account in the next specification iteration. 2014-10-09T19:51:19Z HisaoNakai: o.o 2014-10-09T19:51:39Z turbofail: sure, R5RS plus SRFI's makes an almost usable language 2014-10-09T19:51:54Z DGASAU: HisaoNakai: as I have said it today already, the whole issue is about your goals. 2014-10-09T19:52:14Z DGASAU: There're two sets of people who try to pull Scheme into opposite directions: 2014-10-09T19:52:36Z DGASAU: one group wants programming language to write interpreter for, 2014-10-09T19:52:44Z DGASAU: another group wants programming language that is useful to write in. 2014-10-09T19:53:26Z DGASAU: "Small" language is useful only as a toy. 2014-10-09T19:54:04Z DGASAU: That is it is useful for introductory courses and for writing (toy) interpreters. 2014-10-09T19:54:05Z HisaoNakai: DGASAU: I think I can understand most of what's been said, except...why doesn't the latter group like CL? 2014-10-09T19:54:21Z DGASAU: Because Scheme and CL are different languages. 2014-10-09T19:54:37Z DGASAU: They differ at their core. 2014-10-09T19:55:18Z DGASAU: CL is more classical in nesting behaviour, but it has solid support for generic functions. 2014-10-09T19:55:52Z DGASAU: Scheme is less classical in nesting behaviour for the price of having no generic functions and conditional system. 2014-10-09T19:56:35Z DGASAU: So, there is sense in making Scheme serious programming language. 2014-10-09T19:56:42Z cheater joined #scheme 2014-10-09T19:56:43Z cheater: hi 2014-10-09T19:56:43Z DGASAU: But in order for that, a lot of things should become standard. 2014-10-09T19:56:51Z cheater: in scheme, what does the / function on integers do? 2014-10-09T19:56:52Z DGASAU: "Standard" as not in SRFI. 2014-10-09T19:57:05Z DGASAU: cheater: TIAS. 2014-10-09T19:57:18Z cheater: DGASAU: IDUYA 2014-10-09T19:57:39Z turbofail: rudybot: (/ 3 5) 2014-10-09T19:57:39Z rudybot: turbofail: ; Value: 3/5 2014-10-09T19:57:51Z cheater: this is on integers though 2014-10-09T19:58:02Z turbofail: those are integers 2014-10-09T19:58:08Z turbofail: rudybot: (/ 30 5) 2014-10-09T19:58:08Z rudybot: turbofail: ; Value: 6 2014-10-09T19:58:18Z cheater: hmm ok 2014-10-09T19:58:32Z turbofail: rudybot: (/ 36 5) 2014-10-09T19:58:33Z rudybot: turbofail: ; Value: 36/5 2014-10-09T19:58:42Z DGASAU: rudybot: (/ 4 6) 2014-10-09T19:58:43Z rudybot: DGASAU: your sandbox is ready 2014-10-09T19:58:43Z rudybot: DGASAU: ; Value: 2/3 2014-10-09T20:00:01Z pnkfelix joined #scheme 2014-10-09T20:00:54Z HisaoNakai: Wow, I didn't know rudybot did this o_o 2014-10-09T20:01:04Z DGASAU: HisaoNakai: as for me, I'd fry the first camp. 2014-10-09T20:01:19Z HisaoNakai: o_O 2014-10-09T20:01:32Z DGASAU: If they want toy programming language, they should choose something like Python. 2014-10-09T20:01:44Z _tca: rudybot: (require racket/control) 2014-10-09T20:01:44Z rudybot: _tca: your sandbox is ready 2014-10-09T20:01:44Z rudybot: _tca: Done. 2014-10-09T20:01:48Z gnomon: HisaoNakai, there's a reason DGASAU does not run the #scheme social committee. Just sayin'. 2014-10-09T20:01:56Z HisaoNakai: lol 2014-10-09T20:02:42Z _tca: rudybot: (reset (+ (shift k (+ (k 1) (k 1))) 1)) 2014-10-09T20:02:43Z rudybot: _tca: ; Value: 4 2014-10-09T20:04:03Z _tca: HisaoNakai: another reason why CL isn't comparable to scheme is continuations 2014-10-09T20:07:04Z HisaoNakai: _tca: I don't know a lot of these things (continuations, and nesting behaviour and generic functions earlier)...perhaps I'm too green to be discussing this stuff. 2014-10-09T20:07:27Z Riastradh quit (Ping timeout: 264 seconds) 2014-10-09T20:07:55Z gnomon: HisaoNakai, how about guaranteed tail call optimization? 2014-10-09T20:08:36Z HisaoNakai: ...nope. 2014-10-09T20:09:03Z DGASAU: TCE is pretty much guaranteed in some CL implementations. :) 2014-10-09T20:09:11Z hiroakip quit (Ping timeout: 272 seconds) 2014-10-09T20:09:20Z DGASAU: Same applies to inlining. 2014-10-09T20:09:20Z gnomon: HisaoNakai, have you ever had a recursive program blow up on you because it outgrew the stack? 2014-10-09T20:09:33Z Riastradh joined #scheme 2014-10-09T20:09:46Z HisaoNakai: cheater: what's 'IDUYA'? O_o 2014-10-09T20:09:54Z gnomon: DGASAU, there is a vast gulf between a language guarantee and an implementation guarantee, as we just discussed less than a kilobyte ago. 2014-10-09T20:10:04Z gnomon: HisaoNakai, I Don't Understand Your Answer. 2014-10-09T20:10:07Z DGASAU: gnomon: sure. 2014-10-09T20:10:10Z HisaoNakai: gnomon: I've only ever written some C++. 2014-10-09T20:10:14Z HisaoNakai: gnomon: ah, thanks 2014-10-09T20:10:34Z cheater: hmm I'm wondering why my fib doesn't work ;/ i copied it from here: http://mitpress.mit.edu/sicp/chapter1/node15.html 2014-10-09T20:10:53Z DGASAU: gnomon: OTOH, it is disputable what is worse: condition due to stack overflow or non-termination. 2014-10-09T20:10:59Z cheater: but i'm getting fib 4 = 2 :( 2014-10-09T20:11:57Z drdanmaku quit (Quit: Connection closed for inactivity) 2014-10-09T20:12:16Z gnomon: DGASAU, that is a false dichotomy, as you know. The risk of stack overflows prevents some types of solutions from being implemented; the risk of non-termination is an entirely different beast. 2014-10-09T20:12:51Z DGASAU: gnomon: in production envrionment, reasonably grokkable stack traces are important too. 2014-10-09T20:13:33Z DGASAU: Thus, yes, Scheme and CL lead to different tradeoffs. 2014-10-09T20:13:33Z gnomon: DGASAU, of course, and many Scheme implementations will give you great debug information, including data akin to stack traces. 2014-10-09T20:13:37Z zap` joined #scheme 2014-10-09T20:14:27Z hiroakip joined #scheme 2014-10-09T20:15:10Z theseb quit (Quit: Leaving) 2014-10-09T20:16:05Z mrowe_away is now known as mrowe 2014-10-09T20:16:13Z DGASAU: gnomon: I know that CHICKEN provides really weird debug information that is "akin to" but totally different from stack traces. 2014-10-09T20:17:36Z DGASAU: Due to TCE you miss a lot of information important in tracking problems down. 2014-10-09T20:18:00Z _tca: and due to stack traces polluting with lots of useless information , that does the same 2014-10-09T20:18:02Z didi left #scheme 2014-10-09T20:18:04Z DGASAU: Due to CPS even that is presented in quite distorted way. 2014-10-09T20:19:38Z cheater prefers his monads 2014-10-09T20:20:17Z _tca: cheater: have you seen Eff 2014-10-09T20:20:27Z HisaoNakai: cheater: what? There are monads in Scheme? 2014-10-09T20:20:42Z gnomon: DGASAU, that's like arguing that Scheme programs don't let you use a Java bytecode decompiler. Of course it doesn't; it's a different thing, the same tools and expectations can't apply. 2014-10-09T20:20:43Z _tca: HisaoNakai: there is monads in everything 2014-10-09T20:20:54Z HisaoNakai: o_o 2014-10-09T20:22:14Z gnomon: HisaoNakai, don't worry - every time you read "monad", just mentally replace it with "warm fuzzy thing": http://lambda-the-ultimate.org/node/92#comment-2040 2014-10-09T20:22:54Z HisaoNakai: lol gnomon 2014-10-09T20:23:16Z HisaoNakai: I know a C++ programmer who went mad trying to understand it, I won't be repeating their mistake :p 2014-10-09T20:23:46Z jeremyheiler quit (Read error: Connection reset by peer) 2014-10-09T20:23:50Z cheater: HisaoNakai: dunno, i don't use scheme really.. 2014-10-09T20:23:52Z jeremyheiler joined #scheme 2014-10-09T20:24:29Z HisaoNakai: gnomon: lol re: link 2014-10-09T20:24:38Z DGASAU: There's even a paper on monad implementation in C++... 2014-10-09T20:24:44Z HisaoNakai: DGASAU: wad 2014-10-09T20:25:18Z DGASAU: Though it is really strong templatography. 2014-10-09T20:25:19Z HisaoNakai: that page gnomon linked tho 2014-10-09T20:25:46Z HisaoNakai: long xD 2014-10-09T20:26:00Z _tca: rudybot: (define return list) (define (bind f m) (append-map m f)) (bind '(1 2 3) (lambda (x) (return (+ 1 x)))) 2014-10-09T20:26:01Z rudybot: _tca: but one trick you can do is to use append-map, and return a list of values in the function. (list x) for one value, (list) for none, (list 1 2 3 4 5) for five, whatever 2014-10-09T20:26:03Z Riastradh quit (Ping timeout: 264 seconds) 2014-10-09T20:26:09Z jeapostr1phe joined #scheme 2014-10-09T20:26:17Z _tca: wow rudybot 2014-10-09T20:26:21Z gnomon: HisaoNakai, but it's referentially transparent, so you don't need to read the entire lead-up to be able to reason about it meaningfully. 2014-10-09T20:26:35Z _tca: anyway HisaoNakai ^ monad 2014-10-09T20:26:40Z _tca: nothing magic about haskell 2014-10-09T20:28:52Z jeapostrophe quit (Ping timeout: 260 seconds) 2014-10-09T20:32:11Z vanila: HisaoNakai: as for me, I'd fry the first camp. 2014-10-09T20:32:26Z vanila: that's really offensive, you're literally talking about performing a holocaust 2014-10-09T20:33:07Z vanila: That kind of speech should not be acceptable here 2014-10-09T20:35:09Z cr`nge quit (Ping timeout: 272 seconds) 2014-10-09T20:39:07Z DGASAU: vanila: have any your relatives experienced it? 2014-10-09T20:39:38Z DGASAU: If not, then simply fuck off, since mine did. 2014-10-09T20:39:46Z HisaoNakai: whoa, folks? easy? 2014-10-09T20:41:07Z C-Keen: godwin's law strikes again 2014-10-09T20:43:15Z HisaoNakai: good night for now, and be excellent to each other :\ 2014-10-09T20:43:28Z HisaoNakai quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-09T20:44:20Z taylanub: lrs: I explained you the precise semantics of 'cond' before, through an analogy to maths notation. 2014-10-09T20:49:48Z drdanmaku joined #scheme 2014-10-09T20:51:49Z masm quit (Ping timeout: 258 seconds) 2014-10-09T20:52:00Z daviid quit (Ping timeout: 246 seconds) 2014-10-09T20:55:01Z lrs: taylanub, Yup 2014-10-09T20:55:03Z lrs: What about it 2014-10-09T20:57:17Z davexunit quit (Quit: Later) 2014-10-09T21:00:37Z turbofail: basically, the problem is that it's really hard for us to tell what you understand and what you don't 2014-10-09T21:01:07Z hiroakip quit (Ping timeout: 272 seconds) 2014-10-09T21:01:28Z turbofail: especially when in your responses you use super-loose terminology and syntax 2014-10-09T21:08:53Z gravicappa quit (Remote host closed the connection) 2014-10-09T21:09:56Z cheater: so someone here has implemented fib with tries and type families 2014-10-09T21:10:10Z cheater: and arrows 2014-10-09T21:14:21Z lrs: turbofail, Yeah 2014-10-09T21:14:28Z lrs: Well, Im swedish so english isnt my first language 2014-10-09T21:14:31Z lrs: Second I have ADHD 2014-10-09T21:14:45Z lrs: and third I have a trouble explaining what I think sometimes 2014-10-09T21:16:11Z hiroakip joined #scheme 2014-10-09T21:28:32Z developernotes quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2014-10-09T21:29:57Z karswell joined #scheme 2014-10-09T21:32:57Z developernotes joined #scheme 2014-10-09T21:46:17Z developernotes quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2014-10-09T21:49:29Z developernotes joined #scheme 2014-10-09T21:58:08Z stepnem quit (Ping timeout: 250 seconds) 2014-10-09T21:59:22Z developernotes quit (Quit: Textual IRC Client: www.textualapp.com) 2014-10-09T22:03:20Z tcsc joined #scheme 2014-10-09T22:04:52Z jeapostr1phe quit (Ping timeout: 240 seconds) 2014-10-09T22:08:31Z civodul quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-09T22:16:12Z cheater quit (Ping timeout: 272 seconds) 2014-10-09T22:18:31Z mrowe is now known as mrowe_away 2014-10-09T22:20:35Z zap` left #scheme 2014-10-09T22:27:15Z pnkfelix quit (Ping timeout: 272 seconds) 2014-10-09T22:36:07Z iterrogo quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-09T22:40:17Z hiroakip quit (Ping timeout: 272 seconds) 2014-10-09T22:43:20Z hiroakip joined #scheme 2014-10-09T22:56:53Z jeapostrophe joined #scheme 2014-10-09T23:00:05Z ivanshmakov is now known as ivanshmakov| 2014-10-09T23:04:13Z ivanshmakov joined #scheme 2014-10-09T23:12:01Z mrowe_away is now known as mrowe 2014-10-09T23:13:19Z ehaliewicz joined #scheme 2014-10-09T23:17:01Z ivanshmakov| quit (Quit: I am completely operational, and all my circuits are functioning perfectly.) 2014-10-09T23:30:11Z ehaliewicz quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2014-10-09T23:30:20Z vinleod joined #scheme 2014-10-09T23:30:52Z carc quit (Ping timeout: 260 seconds) 2014-10-09T23:35:19Z hiroakip quit (Ping timeout: 244 seconds) 2014-10-09T23:36:00Z carc joined #scheme 2014-10-09T23:39:30Z c107 quit (Remote host closed the connection) 2014-10-09T23:40:48Z vanila quit (Quit: Leaving) 2014-10-09T23:46:41Z bjz_ quit (Ping timeout: 244 seconds) 2014-10-09T23:54:20Z theseb joined #scheme