2015-03-05T00:00:57Z robot-beethoven joined #scheme 2015-03-05T00:02:38Z joneshf-laptop quit (Ping timeout: 244 seconds) 2015-03-05T00:04:11Z vdamewood quit (Ping timeout: 244 seconds) 2015-03-05T00:08:25Z kongtomorrow quit 2015-03-05T00:08:51Z jawny: ski: thanks so much man! I can't update it now because i gotta leave, but thanks agian 2015-03-05T00:16:02Z ski: jawny : ok. np. yw 2015-03-05T00:16:53Z offby1: w.e. 2015-03-05T00:17:58Z vdamewood joined #scheme 2015-03-05T00:18:21Z stepnem quit (Ping timeout: 250 seconds) 2015-03-05T00:18:57Z jlongster joined #scheme 2015-03-05T00:23:17Z jawny quit (Ping timeout: 246 seconds) 2015-03-05T00:23:18Z kongtomorrow joined #scheme 2015-03-05T00:25:02Z nowhere_man quit (Ping timeout: 246 seconds) 2015-03-05T00:25:10Z nowhereman joined #scheme 2015-03-05T00:27:30Z ASau quit (Remote host closed the connection) 2015-03-05T00:41:09Z ASau joined #scheme 2015-03-05T00:41:23Z daviid quit (Ping timeout: 240 seconds) 2015-03-05T00:42:21Z ASau quit (Remote host closed the connection) 2015-03-05T00:46:55Z sethalves1 quit (Remote host closed the connection) 2015-03-05T00:50:31Z kongtomorrow quit 2015-03-05T00:57:11Z kongtomorrow joined #scheme 2015-03-05T00:58:57Z jlongster quit (Ping timeout: 244 seconds) 2015-03-05T01:01:36Z jlongster joined #scheme 2015-03-05T01:05:22Z King_Hual quit (Ping timeout: 252 seconds) 2015-03-05T01:09:53Z zaon quit (Ping timeout: 240 seconds) 2015-03-05T01:17:19Z jlongster quit (Ping timeout: 245 seconds) 2015-03-05T01:31:14Z turtleman_ joined #scheme 2015-03-05T01:45:06Z jlongster joined #scheme 2015-03-05T01:46:26Z ASau joined #scheme 2015-03-05T01:50:27Z jlongster quit (Ping timeout: 264 seconds) 2015-03-05T01:52:52Z ASau quit (Remote host closed the connection) 2015-03-05T01:54:20Z echo-area joined #scheme 2015-03-05T01:55:38Z Sgeo quit (Read error: Connection reset by peer) 2015-03-05T01:57:18Z ASau joined #scheme 2015-03-05T01:58:49Z Sgeo joined #scheme 2015-03-05T02:02:18Z jlongster joined #scheme 2015-03-05T02:05:18Z kongtomorrow quit 2015-03-05T02:06:36Z jlongster quit (Ping timeout: 246 seconds) 2015-03-05T02:17:01Z pjb` joined #scheme 2015-03-05T02:19:44Z Cheery_ joined #scheme 2015-03-05T02:21:23Z Cheery quit (Ping timeout: 250 seconds) 2015-03-05T02:21:23Z pjb quit (Ping timeout: 250 seconds) 2015-03-05T02:21:23Z tristero quit (Ping timeout: 250 seconds) 2015-03-05T02:21:31Z trystero joined #scheme 2015-03-05T02:22:50Z jlongster joined #scheme 2015-03-05T02:23:23Z BossKonaSegwaY joined #scheme 2015-03-05T02:23:53Z davexunit quit (Quit: Later) 2015-03-05T02:29:04Z jlongster quit (Ping timeout: 272 seconds) 2015-03-05T02:45:43Z kongtomorrow joined #scheme 2015-03-05T02:53:23Z jlongster joined #scheme 2015-03-05T02:58:43Z kaihaosw joined #scheme 2015-03-05T02:58:54Z kaihaosw quit (Client Quit) 2015-03-05T02:59:24Z mdln joined #scheme 2015-03-05T03:02:34Z ArneBab joined #scheme 2015-03-05T03:05:39Z ArneBab_ quit (Ping timeout: 252 seconds) 2015-03-05T03:07:19Z turtleman_ quit (Ping timeout: 252 seconds) 2015-03-05T03:10:52Z ghost|ruuns joined #scheme 2015-03-05T03:13:51Z ruuns quit (Ping timeout: 264 seconds) 2015-03-05T03:15:06Z mdln quit (Remote host closed the connection) 2015-03-05T03:17:48Z jawny joined #scheme 2015-03-05T03:27:54Z mrowe_away is now known as mrowe 2015-03-05T03:34:46Z paroneayea quit (Read error: Connection reset by peer) 2015-03-05T03:35:09Z paroneayea joined #scheme 2015-03-05T03:36:19Z {0}grant joined #scheme 2015-03-05T03:37:03Z {0}grant quit (Remote host closed the connection) 2015-03-05T03:37:25Z {0}grant joined #scheme 2015-03-05T03:40:46Z theseb joined #scheme 2015-03-05T03:44:21Z bb010g joined #scheme 2015-03-05T03:46:31Z mdln joined #scheme 2015-03-05T03:48:57Z taylanub quit (Disconnected by services) 2015-03-05T03:49:23Z mrowe quit (Quit: ZNC - http://znc.sourceforge.net) 2015-03-05T03:49:35Z taylanub joined #scheme 2015-03-05T03:50:02Z Riastradh quit (Remote host closed the connection) 2015-03-05T03:54:03Z {0}grant quit (Ping timeout: 264 seconds) 2015-03-05T03:56:23Z vdamewood quit (Remote host closed the connection) 2015-03-05T04:00:34Z ArneBab_ joined #scheme 2015-03-05T04:00:36Z mdln left #scheme 2015-03-05T04:04:15Z ArneBab quit (Ping timeout: 264 seconds) 2015-03-05T04:07:22Z mark_weaver quit (Ping timeout: 245 seconds) 2015-03-05T04:10:58Z jlongster quit (Ping timeout: 256 seconds) 2015-03-05T04:14:38Z vikraman quit (Quit: Bye!) 2015-03-05T04:19:36Z uber_hulk joined #scheme 2015-03-05T04:29:33Z {0}grant joined #scheme 2015-03-05T04:30:16Z {0}grant quit (Read error: Connection reset by peer) 2015-03-05T04:30:35Z {0}grant joined #scheme 2015-03-05T04:32:47Z Vutral quit (Ping timeout: 245 seconds) 2015-03-05T04:34:07Z mark_weaver joined #scheme 2015-03-05T04:38:12Z jawny quit (Ping timeout: 245 seconds) 2015-03-05T04:49:01Z amgarchIn9 joined #scheme 2015-03-05T04:49:06Z theseb left #scheme 2015-03-05T04:52:09Z alexei___ quit (Ping timeout: 246 seconds) 2015-03-05T04:55:46Z karswell` joined #scheme 2015-03-05T04:57:22Z Vutral joined #scheme 2015-03-05T05:00:32Z daviid joined #scheme 2015-03-05T05:02:16Z karswell` is now known as karswell 2015-03-05T05:20:33Z xyh joined #scheme 2015-03-05T05:50:22Z vikraman joined #scheme 2015-03-05T05:53:03Z zaon joined #scheme 2015-03-05T06:05:39Z tsumetai quit (Ping timeout: 246 seconds) 2015-03-05T06:08:55Z aking quit (Remote host closed the connection) 2015-03-05T06:22:37Z amgarchIn9 quit (Ping timeout: 255 seconds) 2015-03-05T06:23:46Z mtakkman joined #scheme 2015-03-05T06:28:51Z mtakkman quit (Ping timeout: 264 seconds) 2015-03-05T06:32:36Z bjz joined #scheme 2015-03-05T06:33:15Z uber_hulk quit (Quit: Connection closed for inactivity) 2015-03-05T06:39:03Z oleo quit (Read error: Connection reset by peer) 2015-03-05T06:40:20Z oleo joined #scheme 2015-03-05T06:40:34Z mtakkman joined #scheme 2015-03-05T06:46:17Z kaihaosw joined #scheme 2015-03-05T06:46:47Z bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-03-05T06:47:19Z kaihaosw quit (Client Quit) 2015-03-05T06:50:12Z mtakkman quit (Ping timeout: 256 seconds) 2015-03-05T06:52:25Z zaon quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2015-03-05T06:54:44Z xyh quit (Ping timeout: 256 seconds) 2015-03-05T07:03:44Z Isp-sec joined #scheme 2015-03-05T07:17:31Z sbwhitecap quit (Quit: Leaving...) 2015-03-05T07:29:41Z uber_hulk joined #scheme 2015-03-05T07:34:24Z daviid quit (Ping timeout: 245 seconds) 2015-03-05T07:35:15Z wingo joined #scheme 2015-03-05T07:37:32Z zadock quit (Quit: Leaving) 2015-03-05T07:56:30Z larion quit (Ping timeout: 256 seconds) 2015-03-05T07:56:39Z ByronJohnson quit (Quit: Restarting client.) 2015-03-05T07:57:37Z ByronJohnson joined #scheme 2015-03-05T07:57:58Z civodul joined #scheme 2015-03-05T08:03:52Z {0}grant quit (Ping timeout: 256 seconds) 2015-03-05T08:12:29Z adu quit (Quit: adu) 2015-03-05T08:14:17Z {0}grant joined #scheme 2015-03-05T08:17:15Z zadock joined #scheme 2015-03-05T08:34:43Z larion joined #scheme 2015-03-05T08:36:09Z larion quit (Read error: No route to host) 2015-03-05T08:36:15Z przl joined #scheme 2015-03-05T08:39:28Z ecthiender joined #scheme 2015-03-05T08:40:59Z larion joined #scheme 2015-03-05T08:44:51Z gravicappa joined #scheme 2015-03-05T09:01:29Z xyh joined #scheme 2015-03-05T09:01:30Z frkout joined #scheme 2015-03-05T09:01:55Z frkout_ joined #scheme 2015-03-05T09:02:13Z larion quit (Ping timeout: 264 seconds) 2015-03-05T09:05:55Z nee joined #scheme 2015-03-05T09:05:58Z frkout quit (Ping timeout: 265 seconds) 2015-03-05T09:06:27Z ecthiender quit (Ping timeout: 265 seconds) 2015-03-05T09:06:58Z frkout_ quit (Read error: Connection reset by peer) 2015-03-05T09:09:43Z Ruchran joined #scheme 2015-03-05T09:23:31Z vraid quit (Ping timeout: 252 seconds) 2015-03-05T09:23:47Z cky quit (Quit: WeeChat 1.0) 2015-03-05T09:34:26Z pjb` is now known as pjb 2015-03-05T09:36:11Z mtakkman joined #scheme 2015-03-05T09:36:38Z larion joined #scheme 2015-03-05T09:40:56Z ijp quit (Quit: brb trisecting the angle) 2015-03-05T09:44:49Z stepnem joined #scheme 2015-03-05T09:46:01Z mtakkman quit (Ping timeout: 264 seconds) 2015-03-05T09:56:51Z ecthiender joined #scheme 2015-03-05T10:03:15Z uber_hulk quit (Quit: Connection closed for inactivity) 2015-03-05T10:06:21Z echo-area quit (Remote host closed the connection) 2015-03-05T10:10:08Z Isp-sec quit (Ping timeout: 272 seconds) 2015-03-05T10:11:44Z xyh quit (Remote host closed the connection) 2015-03-05T10:21:27Z bjz joined #scheme 2015-03-05T10:22:51Z tsumetai joined #scheme 2015-03-05T10:23:33Z vraid joined #scheme 2015-03-05T10:26:22Z agumonkey joined #scheme 2015-03-05T10:32:57Z mtakkman joined #scheme 2015-03-05T10:37:57Z bjz quit (Ping timeout: 252 seconds) 2015-03-05T10:39:24Z mtakkman quit (Ping timeout: 245 seconds) 2015-03-05T10:54:49Z robot-beethoven quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2015-03-05T11:10:57Z gravicappa quit (Ping timeout: 252 seconds) 2015-03-05T11:13:29Z King_Hual joined #scheme 2015-03-05T11:14:18Z Cheery_ is now known as Cheery 2015-03-05T11:19:12Z ghost|ruuns quit (Remote host closed the connection) 2015-03-05T11:21:57Z bjz joined #scheme 2015-03-05T11:29:20Z pnkfelix joined #scheme 2015-03-05T11:49:12Z alezost joined #scheme 2015-03-05T11:49:32Z kongtomorrow quit 2015-03-05T11:53:09Z pjb` joined #scheme 2015-03-05T11:54:23Z pjb is now known as Guest90101 2015-03-05T11:55:04Z przl quit (Ping timeout: 256 seconds) 2015-03-05T11:55:07Z Guest90101 quit (Ping timeout: 244 seconds) 2015-03-05T12:05:49Z amgarchIn9 joined #scheme 2015-03-05T12:11:52Z wingo quit (Ping timeout: 240 seconds) 2015-03-05T12:15:17Z wingo joined #scheme 2015-03-05T12:18:04Z przl joined #scheme 2015-03-05T12:19:29Z pjb` is now known as pjb 2015-03-05T12:19:53Z wingo quit (Ping timeout: 252 seconds) 2015-03-05T12:23:26Z wingo joined #scheme 2015-03-05T12:36:51Z gravicappa joined #scheme 2015-03-05T12:49:02Z przl quit (Ping timeout: 245 seconds) 2015-03-05T13:06:28Z davexunit joined #scheme 2015-03-05T13:06:43Z amgarchIn9 quit (Ping timeout: 255 seconds) 2015-03-05T13:25:34Z ovenpasta joined #scheme 2015-03-05T13:30:12Z Riastradh joined #scheme 2015-03-05T13:35:27Z przl joined #scheme 2015-03-05T13:36:57Z edgar-rft quit (Quit: edgar-rft) 2015-03-05T13:41:46Z Ruchran quit (Quit: Connection closed for inactivity) 2015-03-05T13:47:12Z BossKonaSegwaY quit (Read error: Connection reset by peer) 2015-03-05T13:53:39Z przl quit (Ping timeout: 256 seconds) 2015-03-05T13:55:17Z b4283 joined #scheme 2015-03-05T13:55:37Z przl joined #scheme 2015-03-05T13:59:53Z turtleman_ joined #scheme 2015-03-05T14:07:15Z turtleman_ quit (Ping timeout: 264 seconds) 2015-03-05T14:09:23Z turtleman_ joined #scheme 2015-03-05T14:09:29Z mtakkman joined #scheme 2015-03-05T14:12:39Z Khisanth quit (Ping timeout: 264 seconds) 2015-03-05T14:19:05Z sethalves quit (Remote host closed the connection) 2015-03-05T14:19:08Z Khisanth joined #scheme 2015-03-05T14:20:02Z sethalves joined #scheme 2015-03-05T14:20:32Z sethalves quit (Remote host closed the connection) 2015-03-05T14:20:45Z mtakkman quit (Ping timeout: 250 seconds) 2015-03-05T14:20:56Z sethalves joined #scheme 2015-03-05T14:27:11Z jlongster joined #scheme 2015-03-05T14:28:23Z Khisanth quit (Ping timeout: 240 seconds) 2015-03-05T14:28:50Z Khisanth joined #scheme 2015-03-05T14:31:42Z b4283 quit (Remote host closed the connection) 2015-03-05T14:32:08Z b4283 joined #scheme 2015-03-05T14:33:44Z psy_ quit (Ping timeout: 244 seconds) 2015-03-05T14:39:21Z theseb joined #scheme 2015-03-05T14:49:34Z Bahman joined #scheme 2015-03-05T14:49:46Z theseb quit (Ping timeout: 255 seconds) 2015-03-05T14:49:55Z ruuns joined #scheme 2015-03-05T14:56:50Z theseb joined #scheme 2015-03-05T14:58:30Z badkins joined #scheme 2015-03-05T14:59:23Z Khisanth quit (Ping timeout: 246 seconds) 2015-03-05T15:01:34Z xyh joined #scheme 2015-03-05T15:03:53Z mtakkman joined #scheme 2015-03-05T15:04:16Z mtakkman quit (Remote host closed the connection) 2015-03-05T15:06:06Z mtakkman joined #scheme 2015-03-05T15:06:27Z mtakkman quit (Remote host closed the connection) 2015-03-05T15:06:30Z psy_ joined #scheme 2015-03-05T15:06:30Z psy_ quit (Client Quit) 2015-03-05T15:07:27Z oleo quit (Quit: Leaving) 2015-03-05T15:07:29Z Khisanth joined #scheme 2015-03-05T15:08:28Z mtakkman joined #scheme 2015-03-05T15:11:31Z oleo joined #scheme 2015-03-05T15:11:31Z oleo quit (Changing host) 2015-03-05T15:11:31Z oleo joined #scheme 2015-03-05T15:13:20Z Khisanth quit (Ping timeout: 246 seconds) 2015-03-05T15:16:04Z mtakkman quit (Ping timeout: 245 seconds) 2015-03-05T15:18:51Z Khisanth joined #scheme 2015-03-05T15:21:22Z uber_hulk joined #scheme 2015-03-05T15:25:00Z jumblerg joined #scheme 2015-03-05T15:29:49Z Khisanth quit (Ping timeout: 245 seconds) 2015-03-05T15:32:47Z jlongster quit (Ping timeout: 245 seconds) 2015-03-05T15:38:07Z Khisanth joined #scheme 2015-03-05T15:41:05Z pecg joined #scheme 2015-03-05T15:41:27Z jumblerg quit (Quit: My Mac has gone to sleep. ZZZzzz…) 2015-03-05T15:42:37Z aretecode joined #scheme 2015-03-05T15:43:33Z jumblerg joined #scheme 2015-03-05T15:49:37Z fadein quit (Ping timeout: 264 seconds) 2015-03-05T15:52:26Z mtakkman joined #scheme 2015-03-05T15:55:26Z psy_ joined #scheme 2015-03-05T15:56:31Z Khisanth quit (Ping timeout: 250 seconds) 2015-03-05T15:59:36Z fadein joined #scheme 2015-03-05T16:04:01Z mtakkman quit (Ping timeout: 264 seconds) 2015-03-05T16:08:38Z jlongster joined #scheme 2015-03-05T16:17:55Z Khisanth joined #scheme 2015-03-05T16:20:21Z ecthiender quit (Quit: gotta go) 2015-03-05T16:29:25Z nee quit (Read error: Connection reset by peer) 2015-03-05T16:29:36Z narendraj9 joined #scheme 2015-03-05T16:34:55Z paroneayea quit (Read error: Connection reset by peer) 2015-03-05T16:35:26Z paroneayea joined #scheme 2015-03-05T16:40:49Z larion quit (Ping timeout: 256 seconds) 2015-03-05T16:47:27Z turtleman_ quit (Ping timeout: 264 seconds) 2015-03-05T16:49:02Z leppie quit (Ping timeout: 245 seconds) 2015-03-05T16:50:56Z pnkfelix quit (Ping timeout: 265 seconds) 2015-03-05T16:51:34Z joneshf-laptop joined #scheme 2015-03-05T16:56:55Z jumblerg quit (Quit: My Mac has gone to sleep. ZZZzzz…) 2015-03-05T16:57:21Z joast quit (Quit: Leaving.) 2015-03-05T17:00:25Z leppie joined #scheme 2015-03-05T17:05:45Z civodul quit (Quit: ERC Version 5.3 (IRC client for Emacs)) 2015-03-05T17:08:05Z jawny joined #scheme 2015-03-05T17:08:38Z mtakkman joined #scheme 2015-03-05T17:10:34Z zadock quit (Quit: Leaving) 2015-03-05T17:21:18Z narendraj9 quit (Quit: WeeChat 1.1.1) 2015-03-05T17:25:22Z mtakkman quit (Ping timeout: 240 seconds) 2015-03-05T17:31:24Z adu joined #scheme 2015-03-05T17:32:40Z vraid quit (Ping timeout: 255 seconds) 2015-03-05T17:33:09Z leppie quit (Ping timeout: 250 seconds) 2015-03-05T17:35:22Z jumblerg joined #scheme 2015-03-05T17:37:39Z sethalves1 joined #scheme 2015-03-05T17:37:42Z leppie joined #scheme 2015-03-05T17:39:04Z daviid joined #scheme 2015-03-05T17:42:37Z rszeno joined #scheme 2015-03-05T17:44:34Z amgarchIn9 joined #scheme 2015-03-05T17:44:52Z joast joined #scheme 2015-03-05T17:45:34Z joast quit (Remote host closed the connection) 2015-03-05T17:46:28Z joast joined #scheme 2015-03-05T17:46:38Z joast quit (Remote host closed the connection) 2015-03-05T17:47:31Z jawny quit (Quit: Leaving) 2015-03-05T17:48:47Z przl quit (Ping timeout: 252 seconds) 2015-03-05T17:52:29Z przl joined #scheme 2015-03-05T17:53:48Z pnkfelix joined #scheme 2015-03-05T17:54:31Z joast joined #scheme 2015-03-05T17:56:16Z joast quit (Client Quit) 2015-03-05T18:00:03Z ELLIOTTCABLE quit (Disconnected by services) 2015-03-05T18:00:04Z przl quit (Ping timeout: 264 seconds) 2015-03-05T18:00:25Z b4283 quit (Quit: Konversation terminated!) 2015-03-05T18:05:31Z Riastradh quit (Ping timeout: 255 seconds) 2015-03-05T18:14:01Z vraid joined #scheme 2015-03-05T18:18:42Z Vutral quit (Ping timeout: 256 seconds) 2015-03-05T18:24:52Z hedge256 joined #scheme 2015-03-05T18:25:25Z hedge256 is now known as hedge 2015-03-05T18:26:52Z hedge quit (Client Quit) 2015-03-05T18:29:08Z jawny joined #scheme 2015-03-05T18:30:31Z liqu0rice joined #scheme 2015-03-05T18:32:58Z Vutral joined #scheme 2015-03-05T18:33:45Z jawny: http://paste.lisp.org/display/146093, my listleaves function for listing the leaves of a binary tree in scheme. It returns '(c () f e) where c is '(c () ()). The nodes are lists with '(symbol leftsubtree rightsubtree). 2015-03-05T18:34:35Z jawny: I want it to not return '(c () f e), but instead return '(c f e). Also, for my cond it never reaches the last two cases. A current fix I'm going to do now is to redefine other helper methods I have so they do not take in null. 2015-03-05T18:34:59Z amgarchIn9 quit (Ping timeout: 252 seconds) 2015-03-05T18:35:45Z Isp-sec joined #scheme 2015-03-05T18:38:04Z jawny: http://paste.lisp.org/display/146093#1, updated version 2015-03-05T18:38:09Z pjb: your condition was wrong. 2015-03-05T18:38:31Z pjb: You want (and (not (null? (leftsubt bt))) (not (null? (rightsubt bt)))) 2015-03-05T18:38:42Z pjb: (not (and a b)) <=> (or (not a) (not b)) 2015-03-05T18:39:04Z pjb: (and (not a) (not b)) <=> (not (or a b)) 2015-03-05T18:39:24Z joast joined #scheme 2015-03-05T18:39:38Z pjb: Notice that you could tst in sequence only for nulls. 2015-03-05T18:39:40Z joast quit (Remote host closed the connection) 2015-03-05T18:40:09Z pjb: (cond ((and (null? a) (null? b)) …) ((null? a) …) ((null? b) …) (else …)) 2015-03-05T18:40:15Z jawny: pjb: Oh, ok, I'll add that change! 2015-03-05T18:40:20Z pjb: But in such a case, it would be more efficient to use embedded ifs: 2015-03-05T18:40:31Z pjb: (if (null? a) (if (null? b) … …) (if (null? b) … …)) 2015-03-05T18:41:56Z jawny: pjb: I made the first change you suggested but I'm not sure if I have all the parantheses in the right places 2015-03-05T18:42:52Z pjb: use emacs and paredit, it helps with parentheses. 2015-03-05T18:43:09Z joast joined #scheme 2015-03-05T18:43:19Z ski: jawny uses Dr. Racket 2015-03-05T18:43:26Z pjb: oh. 2015-03-05T18:43:35Z pjb: I don't know the features of Dr. Racket. 2015-03-05T18:43:43Z ski: it has bracket matching 2015-03-05T18:43:50Z jawny: ski: hey ski! 2015-03-05T18:43:57Z ski blinks 2015-03-05T18:44:18Z jawny: and should I use something else besides Dr. Racket? My prof recommended it, but I was thinking of just using emacs or something. 2015-03-05T18:44:29Z ski: it's probably fine for now 2015-03-05T18:44:47Z ski: (it has some other features that are helpful for beginners) 2015-03-05T18:45:14Z jawny: http://paste.lisp.org/display/146093#2, here's an updated version 2015-03-05T18:45:18Z pjb: Yes, the debugger in Dr. Racket is nice, showing the control flow with arrows :-) 2015-03-05T18:45:19Z joast quit (Client Quit) 2015-03-05T18:45:34Z jawny: The debugger is bomb, I like it a lot. 2015-03-05T18:45:38Z pjb: jawny: you get your conditions wrong. 2015-03-05T18:45:47Z joast joined #scheme 2015-03-05T18:45:49Z ski: it's not clear what the test tree is in the above 2015-03-05T18:45:58Z pjb: jawny: no, sorry, they're right now. 2015-03-05T18:46:17Z jawny: ski: a shoot, I'm sorry I keep on forgetting to put the test tree in there, I'll annotate real quick 2015-03-05T18:46:28Z joast quit (Client Quit) 2015-03-05T18:46:40Z pjb: jawny: if you would put the first cond clausein the last position, you wouldn't have to perform the test, you could use else. 2015-03-05T18:46:42Z ski: well, in there, or in your message here (unless it's huge) 2015-03-05T18:46:53Z rszeno quit (Ping timeout: 240 seconds) 2015-03-05T18:47:05Z ski: anyway, your latter two `cond' clauses looks suspicious 2015-03-05T18:47:57Z jawny: http://paste.lisp.org/display/146093#3 2015-03-05T18:48:07Z ski also again suggests making an `empty-tree?' or `tree-node?' (or both) predicate 2015-03-05T18:48:16Z jawny: ski: ill get to that! 2015-03-05T18:49:00Z joast joined #scheme 2015-03-05T18:49:10Z joast quit (Client Quit) 2015-03-05T18:49:13Z jawny: pjb: so you're saying to move the first cond clause to the final position and make it the else part of cond? 2015-03-05T18:49:45Z joast joined #scheme 2015-03-05T18:50:08Z ski: (i see no point in abstracting partway by (defining and) using `leftsubt',`rightsubt',`contents', for `listleaves', but then letting (part of) the concrete representation show when you're using `null?') 2015-03-05T18:50:57Z jawny: ski: make sense, I think what you suggested will give me a lot cleaner code 2015-03-05T18:50:57Z ski: (and yes, a nested `if' would be slightly more efficient here) 2015-03-05T18:50:59Z joast quit (Client Quit) 2015-03-05T18:51:59Z joast joined #scheme 2015-03-05T18:52:55Z jawny: ski: for the nested if would you suggest: if it has no subtrees, (list (contents)) else, then go into the cond? 2015-03-05T18:53:11Z pjb: (c () e) comes from recursing in the wrong child. 2015-03-05T18:53:12Z pjb: http://paste.lisp.org/+34Q5/4 2015-03-05T18:53:55Z pjb: using null? like this could indeed considered a Common-Lispism :-) 2015-03-05T18:54:32Z jawny: pjb: what do you mean by common-lispism? 2015-03-05T18:54:48Z pjb: In CL, NIL is the empty list and the false boolean. 2015-03-05T18:55:02Z pjb: So we often use it to denote no value. 2015-03-05T18:55:14Z pjb: (right-child node) --> NIL means there's no right-child. 2015-03-05T18:55:37Z pjb: In Scheme you have to choose, between (), nil and #f, knowing that () and nil are true… 2015-03-05T18:56:02Z oleo_ joined #scheme 2015-03-05T18:56:07Z pjb: Then perhaps it would be better to have TWO functions: (have-left-child? node) (left-child node) 2015-03-05T18:56:24Z jawny: Ah ok. And thanks for the solution. I thought cond was better to use over have several nested if statements? 2015-03-05T18:56:46Z pjb: (if (have-left-child? node) (if (have-right-child? node) (append (list-leaves (left-child node)) (list-leaves (right-child node))) … 2015-03-05T18:56:47Z ski: it depends 2015-03-05T18:57:25Z pjb: If you do that, you can even simplify it as: (append (if (has-left-child? node) (list-leaves (left-child node)) '()) (if (has-right-child? node) (list-leaves (right-child node)) '())) 2015-03-05T18:57:41Z ski: `cond' is good if you either have a number of disjoint conditions on which to act, or a sequence of conditions to try in case all previous failed 2015-03-05T18:58:00Z ski: for nested stuff, it's better to write nested code (like pjb's in that paste) 2015-03-05T18:58:04Z pjb: Ah yes, you need to collect the leaves, so you have to detect them anyways. 2015-03-05T18:58:22Z oleo quit (Ping timeout: 256 seconds) 2015-03-05T18:59:03Z pjb: It may be useful to (define (leave? node) (not (or (has-left-child? node) (has-right-child? node)))) 2015-03-05T18:59:05Z ski: whether to do it nestedly here or not i'd say is a matter of taste. there is some small inefficiency of recomputing `null?'/`empty-tree?' on the trees, but in this case those are constant-time (and -space) operations, so it doesn't matter that much .. 2015-03-05T18:59:37Z pjb: Then (define (list-leaves node) (if (leave? node) (list (contents node)) (append (if (has-left-child? node) (list-leaves (left-child node)) '()) (if (has-right-child? node) (list-leaves (right-child node)) '())))) 2015-03-05T18:59:55Z jawny: Cool 2015-03-05T19:00:00Z jawny: Thanks so much guys! 2015-03-05T19:00:28Z ski: for more than two booleans to check, the number of disjoint conditions for a `cond' starts to explode, which is a reason not to do that (hard to read code that is that very verbose, with lots of repetition. you still have to check manually that every case does what you expect, that there's no typo or thinko in one of them. bad) 2015-03-05T19:00:32Z pjb: ski: entirely correct, however, if you notice that you're doing repeatitive tests like this, it can be a hint that you can find a more elegant expressions avoiding them. 2015-03-05T19:01:17Z mtakkman joined #scheme 2015-03-05T19:01:20Z ELLIOTTCABLE_ joined #scheme 2015-03-05T19:01:29Z ski: pjb : good idea about the `have-left-child?',`have-right-child?' 2015-03-05T19:01:35Z ELLIOTTCABLE_ is now known as ELLIOTTCABLE 2015-03-05T19:01:55Z pjb: that seems to work better in scheme, yes. 2015-03-05T19:02:03Z ski . o O ( s/leave/leaf/ ) 2015-03-05T19:02:12Z pjb: and has- rather than have- :-) 2015-03-05T19:02:30Z jawny: pjb: real quick question on your solution, so for the if statement with two nested if statements, the first nested one is if the if-statement is true and the second once is the else, correct? 2015-03-05T19:02:32Z ski: pjb : yes 2015-03-05T19:02:43Z jawny: pjb: i just wanna see if I have a better understanding of scheme 2015-03-05T19:02:49Z ski: jawny : yep 2015-03-05T19:02:55Z pjb: jawny: yes. (if test then-expr else-expr) 2015-03-05T19:02:56Z jawny: ski: cool thanks! 2015-03-05T19:03:28Z pjb: jawny: notice the last define I put above. 2015-03-05T19:03:56Z pjb: Once you insert the newlines and indent it, it should be a nicer form, I think. 2015-03-05T19:04:44Z rszeno joined #scheme 2015-03-05T19:05:38Z jawny: Thanks so much for all your help guys, I'll do all your suggestions, this code looks super nice now and a lot more understandable. 2015-03-05T19:06:16Z zadock joined #scheme 2015-03-05T19:06:53Z jawny: Is there anyway to get rid of the lisp pastebin? 2015-03-05T19:10:24Z ski: depends on whether you selected "Never expires (recommended)" or not when you made the paste 2015-03-05T19:11:16Z jawny: Ah, I have it expiring in a week. I just hope that when I submit the code it won't be flagged as copied because I posted the code online 2015-03-05T19:11:27Z pjb: :-) 2015-03-05T19:13:15Z uber_hulk quit (Quit: Connection closed for inactivity) 2015-03-05T19:15:40Z hiroakip joined #scheme 2015-03-05T19:17:26Z jawny: Anyway though, thanks so much guys! 2015-03-05T19:17:59Z ovenpasta quit (Ping timeout: 246 seconds) 2015-03-05T19:19:23Z mtakkman quit (Ping timeout: 246 seconds) 2015-03-05T19:24:34Z amgarchIn9 joined #scheme 2015-03-05T19:35:41Z King_Hual` joined #scheme 2015-03-05T19:38:58Z jumblerg quit (Quit: My Mac has gone to sleep. ZZZzzz…) 2015-03-05T19:39:45Z King_Hual quit (Ping timeout: 246 seconds) 2015-03-05T19:45:37Z liqu0rice quit (Quit: leaving) 2015-03-05T19:49:25Z alezost quit (Ping timeout: 252 seconds) 2015-03-05T20:09:51Z pnkfelix quit (Ping timeout: 246 seconds) 2015-03-05T20:15:11Z monod joined #scheme 2015-03-05T20:20:51Z jawny: When should I use eq? , = , or eqv? 2015-03-05T20:22:30Z gravicappa quit (Remote host closed the connection) 2015-03-05T20:23:06Z LeoNerd: When you care about referential identity vs. value equivalence 2015-03-05T20:23:26Z LeoNerd: (eqv? (list 1 2 3) (list 1 2 3)) is true, because the two lists have equivalent values 2015-03-05T20:23:35Z LeoNerd: Er.. equal? 2015-03-05T20:23:55Z LeoNerd: (eq? (list 1 2 3) (list 1 2 3)) is false, because the list function returns a newly-constructed list every time 2015-03-05T20:25:27Z rszeno quit (Read error: Connection reset by peer) 2015-03-05T20:27:45Z jawny: LeoNerd: Cool, thanks! 2015-03-05T20:29:02Z jlongster quit (Ping timeout: 256 seconds) 2015-03-05T20:33:59Z _Eris_ left #scheme 2015-03-05T20:36:05Z turtleman_ joined #scheme 2015-03-05T20:40:20Z edgar-rft joined #scheme 2015-03-05T20:40:50Z pjb: and = is for numbers. 2015-03-05T20:41:36Z LeoNerd: Yah; I'm less sure why you'd use = over eqv? 2015-03-05T20:41:52Z pjb: because (eqv? 2 2.0) is false. 2015-03-05T20:41:57Z LeoNerd: Given two numbers, they behave identically. Given one or more things that aren't numbers, ='s behaviour isn't specified 2015-03-05T20:41:59Z LeoNerd: Hrm? 2015-03-05T20:42:02Z pjb: (= 2 2.0) is true. 2015-03-05T20:42:15Z LeoNerd: I thought that was the point of eqv? as compared plain eq? 2015-03-05T20:42:42Z pjb: check the r5rs standard. 2015-03-05T20:42:46Z LeoNerd: eqv? doesn't -deeply- walk inside non-identical aggregates (vectors, cons, strings), but does compare that two numbers are numerically equivalent 2015-03-05T20:43:14Z pjb: http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_idx_210 2015-03-05T20:43:14Z rudybot: http://tinyurl.com/3ekcm2 2015-03-05T20:43:25Z pjb: says: obj1 and obj2 are both numbers, are numerically equal (see =, section 6.2), and are either both exact or both inexact. 2015-03-05T20:43:41Z LeoNerd: Ooooh 2015-03-05T20:43:43Z pjb: 2 is exact, 2.0 is inexact, so they're not both exact or both inexact, therefore they're not eqv?. 2015-03-05T20:43:45Z LeoNerd: Ofcourse, exactness 2015-03-05T20:43:58Z LeoNerd: OK that's fair enough, I'd forgotten about that 2015-03-05T20:45:08Z alezost joined #scheme 2015-03-05T20:47:24Z jlongster joined #scheme 2015-03-05T20:52:39Z bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-03-05T20:58:14Z Bahman quit (Quit: Ave atque vale) 2015-03-05T21:00:54Z civodul joined #scheme 2015-03-05T21:03:37Z pnkfelix joined #scheme 2015-03-05T21:07:50Z davexunit quit (Quit: Later) 2015-03-05T21:10:01Z sethalves1 quit (Ping timeout: 244 seconds) 2015-03-05T21:21:19Z sethalves1 joined #scheme 2015-03-05T21:23:10Z vishesh joined #scheme 2015-03-05T21:24:10Z Riastradh joined #scheme 2015-03-05T21:25:32Z ijp joined #scheme 2015-03-05T21:30:07Z bb010g quit (Quit: Connection closed for inactivity) 2015-03-05T21:34:43Z taylanub: golden rule: if you can write a procedure that can discern, in ANY way at all, between inputs a and b, then (eqv? a b) => #f 2015-03-05T21:35:37Z vishesh quit (Ping timeout: 265 seconds) 2015-03-05T21:37:15Z ovenpasta joined #scheme 2015-03-05T21:43:31Z theseb quit (Quit: Leaving) 2015-03-05T22:01:47Z jawny: So right now I'm working on a function that tells you whether or not a number is in a binary search tree. So far it works if the input is actually in the bst (it'll return true), but I get an error if I ask for a number not in the bst: contract violation expected: real? given: (). 2015-03-05T22:02:24Z jawny: I know this is because I have it recursively go through the tree, but in my code an input not in the bst will never reach the else statement declaring it to be false. 2015-03-05T22:03:08Z taylanub: jawny: you're passing the empty-list (aka null, aka '()) object to a procedure that expects a real number. guess: you're lacking a termination statement that catches the situation where you hit an end in the tree 2015-03-05T22:04:53Z jawny: taylanub: mmm, that's what I figured. Right now I have it set up in a cond, where the condition is if it equals the contents of a node, return true, else if the item is greater than the node go right and if not go left. I have a final else statement declaring it to be #f, but the input gets stuck in the recursive calls in the if statement, causing the error. 2015-03-05T22:05:19Z jawny: taylanub: I feel like I'm really close, but talking it out really helps out and I like getting advice from you guys :) 2015-03-05T22:06:11Z taylanub: jawny: so at some point you get () instead of a number, then you try to compare this () to a number to see whether it's greater or smaller 2015-03-05T22:06:50Z jawny: taylanub: yup, what ends up happening is that it either takes the right or left subtree of a leaf, thus passing () and then trys to compare the input against () when it wants a real number 2015-03-05T22:07:17Z taylanub: so just add a cond clause like ((null? obj) #f) to the start maybe? 2015-03-05T22:07:23Z jawny: taylanub: a node represented as (symbol leftsubtree rightsubtree) 2015-03-05T22:07:50Z jawny: taylanub: duh, I can't believe I didn't see that, thanks so much! I'll try that out and let you know how it goes. 2015-03-05T22:08:13Z taylanub: (or (null? node) or so, kinda blurry right now, and I actually never worked with balanced binary trees IIRC) 2015-03-05T22:08:28Z larion joined #scheme 2015-03-05T22:09:14Z pjb: jawny: you seem to have difficulty writing test cases. For recursive functions it's usually quite easy to write them, since all the cases are readily apparent. If you have a cond, then you need to design test parameters for each of the branches of the cond (ie. each of the base cases, and each of the recursive cases). 2015-03-05T22:09:28Z vishesh joined #scheme 2015-03-05T22:09:32Z pjb: jawny: then you can try them each, and debug the cases you got wrong. 2015-03-05T22:10:07Z jawny: pjb: ok gotcha! I 2015-03-05T22:12:40Z alezost quit (Quit: I use GNU Guix ) 2015-03-05T22:15:22Z monod quit (Quit: Sto andando via) 2015-03-05T22:16:51Z jawny: [(null? (contents bst)) #f], this is the first condition to my cond. So far when I give an input that doesn't belong in the bst the program stop which is good, but it doesn't print out #f 2015-03-05T22:17:25Z pjb: So your test case will be (bst '(() () ())) right? 2015-03-05T22:17:32Z pjb: What result does this give? 2015-03-05T22:18:13Z pjb: or is it: (search 42 '(() () ())) ? 2015-03-05T22:18:51Z jawny: (bsearch item bst) 2015-03-05T22:18:56Z pjb: ok 2015-03-05T22:19:04Z pjb: So what does (bsearch 42 '(() () ())) return ? 2015-03-05T22:20:29Z jawny: I kinda fixed the issue, I think. That returns false, but only because I changed the first condition of my cond from just #f to (display #f). 2015-03-05T22:20:46Z jawny: So my function is working now, I'm just curious to why it wouldn't show #f before. 2015-03-05T22:21:10Z pjb: you should not mix I/O with other computing in the same function. 2015-03-05T22:21:28Z jawny: pjb: yeah I had a feeling that I shouldn't be doing (display #f) in the function 2015-03-05T22:21:40Z pjb: [(null? (contents bst)) #f] doesn't test whether the node contains the item, but whether the node contains an empty list as contents. 2015-03-05T22:22:03Z pjb: jawny: well, you can use display to debug a function. 2015-03-05T22:22:52Z kongtomorrow joined #scheme 2015-03-05T22:22:54Z kongtomorrow quit (Client Quit) 2015-03-05T22:23:10Z taylanub: if your function returns #f then the REPL will normally display that. if in doubt, you could do something like (if (not (my-function)) (display "yes!\n")) to verify it returns false 2015-03-05T22:23:31Z jawny: pjb: my second cond tests whether the node contains the item, I put [(null? (contents bst)) #f] before it to catch things not in the bst 2015-03-05T22:23:45Z jawny: taylanub: cool, thanks! 2015-03-05T22:23:47Z pjb: jawny: no. 2015-03-05T22:24:04Z pjb: jawny: you test whether a node of your bst contains (); that's all. 2015-03-05T22:24:58Z kongtomorrow joined #scheme 2015-03-05T22:25:02Z pjb: jawny: if you step back, the point of bsearch is to find if the thing is in the bst or not. You cannot test it directly, because this bsearch that does this test! 2015-03-05T22:25:20Z pjb: ie. if you want to test it, you have to perform a recursive call. 2015-03-05T22:25:50Z pjb: (define (bsearch item bst) (cond [(bsearch item bst) …] …)) would be an infinite loop. 2015-03-05T22:26:10Z jawny: pjb: ah shoot, yeah you're totally right. But in this same instance, would it work? Because if I pass () to bsearch that means effectively that the item cannot be in the bst, since I recursively call bsearch on the left child or right child, so if I reach a leaf and call right/left-child to bsearch I'll get () 2015-03-05T22:26:18Z pjb: jawny: what is the fundamental property of a binary search tree? 2015-03-05T22:26:51Z jawny: pjb: I guess that there's a root, where the left of the node is less than the node and the right is greater than the node 2015-03-05T22:27:14Z pjb: all the values stored in the left subtree are less than the value stored in the node. 2015-03-05T22:27:25Z jawny: pjb: yup 2015-03-05T22:27:56Z pjb: so you have three cases: (< item (contents bst)) (= item (contents bst)) and (> item (contents bst)). 2015-03-05T22:28:23Z jawny: Yup currently I have it set up as such (if I were to take out the null case): 2015-03-05T22:28:34Z jawny: if it equals the contents in the node 2015-03-05T22:28:46Z pjb: then it is in the tree! 2015-03-05T22:28:51Z pjb: In the first and last case, you must also test whether there is a left or right subtree. 2015-03-05T22:29:21Z jawny: then it goes into an if statement, where if its larger than the contents in the node, call bsearch on the right-child and if not, call bsearch on the left-child 2015-03-05T22:29:56Z pjb: Yes. And if there's no corresponding subtree, what does that mean? 2015-03-05T22:30:39Z jawny: pjb: : that there the search is at a leaf, right? 2015-03-05T22:31:11Z pjb: Yes. 2015-03-05T22:31:17Z pjb: And therefore? 2015-03-05T22:31:44Z jawny: pjb: does that mean that if the search is at a leaf, then the item cannot be in the tree? 2015-03-05T22:32:04Z jawny: pjb: because all routes are exhausted? 2015-03-05T22:32:28Z pjb: Not _all_ routes, but the route for the item leads to no node containing it. 2015-03-05T22:32:28Z daviid quit (Ping timeout: 264 seconds) 2015-03-05T22:32:34Z pjb: (define (bsearch item bst) (cond ((< item (contents bst)) (if (has-left-child? bst) (bsearch item (left-child bst)) #f)) ((> item (contents bst)) (if (has-right-child? bst) (bsearch item (right-child bst)) #f)) (else #t)) 2015-03-05T22:32:56Z jawny: Oh yeah, makes sense, because only that route can contain that item, but if it's at a leaf, then that means the bst doesn't have that item! 2015-03-05T22:33:24Z jawny: I swear pjb you're the man. I'm gonna go on irc all the time now, just talking about all of this has helped me to understand recursion and scheme so much more. 2015-03-05T22:33:30Z pjb: It's not necessarily a leaf. It can be a node with a right subtree, no left subtree, and the item is less than the node value. 2015-03-05T22:33:41Z jawny: Ah gotcha. 2015-03-05T22:34:58Z pjb: the important point, is that there may be elements on the left of the node in the tree, But if that's the case, we already have compared the item with the value of upper nodes, and found it greater than them, so if there's no left child, no other node can be equal to that item. 2015-03-05T22:35:57Z pjb: you should draw little trees, to better visualise those explainations and the code. 2015-03-05T22:36:31Z jawny: pjb: you must be a mind reader because I started doing that once you posted the code and explanations haha 2015-03-05T22:36:44Z pjb: Good :-) 2015-03-05T22:42:54Z jawny: pjb: You're the man. 2015-03-05T22:43:10Z pjb: jawny: notice how I avoided to use = above. 2015-03-05T22:43:29Z pjb: If you may have inexact values (floating points), it's always better if you can avoid =. 2015-03-05T22:47:32Z jawny: pjb: right? because wouldn't (= 2 2.0) return #f? 2015-03-05T22:47:48Z pjb: No, (= 2 2.0) is true. 2015-03-05T22:48:03Z BossKonaSegwaY joined #scheme 2015-03-05T22:48:27Z pjb: Actually, this is a little some cargo-cult programming, since we're not implementing a numeric algorithm. 2015-03-05T22:49:49Z vishesh quit (Ping timeout: 252 seconds) 2015-03-05T22:49:53Z pjb: If we build a binary search tree with floating point values, then we have definite values to search for. If we compute a value that is close to a node, but not exactly it, the bst is still a discrete tool, and it will be found or not whether we use < and > or < and = (assuming a reasonable implementation of floating points). 2015-03-05T22:51:26Z pjb: We could add an epsilon parameter to compare floating points approximately if we needed to find results of numerical computations. In that case using < and > instead of < and = would be advantageous and natural. 2015-03-05T22:52:48Z pjb: The real avantage to avoid = is that it lets you parameterise the search by providing an explicit < parameter, and you can use (< item (contents bst)) and (< (contents bst) item) for the two tests. So you need a single < parameter to compare the nodes. 2015-03-05T22:53:31Z jawny: pjb: ah ok. What do you mean by an epsilon parameter? Is that along the same lines as an epsilon transistion in a non-deterministic finite automata? 2015-03-05T22:53:37Z jawny: pjb: for comp theory? 2015-03-05T22:53:56Z pjb: No, numerical algorithms, is to compare floating points: a=b <=> |a-b|