2015-12-16T00:09:06Z jcowan joined #scheme 2015-12-16T00:12:40Z jkraemer quit (Ping timeout: 245 seconds) 2015-12-16T00:26:01Z jkraemer joined #scheme 2015-12-16T00:38:23Z hiroakip quit (Ping timeout: 255 seconds) 2015-12-16T00:51:06Z cdidd quit (Ping timeout: 260 seconds) 2015-12-16T01:07:18Z NeverDie quit (Quit: http://radiux.io/) 2015-12-16T01:22:08Z zdm joined #scheme 2015-12-16T01:25:00Z NeverDie joined #scheme 2015-12-16T01:27:00Z niklasl4 quit (Quit: Nettalk6 - www.ntalk.de) 2015-12-16T01:31:10Z petercommand joined #scheme 2015-12-16T01:31:13Z petercommand quit (Changing host) 2015-12-16T01:31:14Z petercommand joined #scheme 2015-12-16T01:39:31Z Riastradh joined #scheme 2015-12-16T01:52:39Z duggiefresh joined #scheme 2015-12-16T01:53:08Z duggiefresh quit (Remote host closed the connection) 2015-12-16T01:54:46Z niklasl4 joined #scheme 2015-12-16T02:00:58Z failproofshark joined #scheme 2015-12-16T02:10:51Z davexunit joined #scheme 2015-12-16T02:23:00Z moredhel quit (Remote host closed the connection) 2015-12-16T02:24:07Z aap_ joined #scheme 2015-12-16T02:24:17Z duggiefresh joined #scheme 2015-12-16T02:27:30Z aap quit (Ping timeout: 250 seconds) 2015-12-16T02:30:22Z duggiefresh quit (Remote host closed the connection) 2015-12-16T02:33:41Z badkins quit (Remote host closed the connection) 2015-12-16T02:36:45Z zdm quit (Ping timeout: 255 seconds) 2015-12-16T02:42:36Z bb010g joined #scheme 2015-12-16T02:50:42Z aretecode quit (Quit: Toodaloo) 2015-12-16T02:53:04Z davexunit quit (Quit: Later) 2015-12-16T02:57:17Z sethalves quit (Quit: Leaving.) 2015-12-16T03:05:03Z neoncontrails quit (Remote host closed the connection) 2015-12-16T03:07:55Z taij33n- quit (Ping timeout: 240 seconds) 2015-12-16T03:13:12Z taij33n joined #scheme 2015-12-16T03:15:55Z Riastradh quit (Ping timeout: 260 seconds) 2015-12-16T03:31:53Z duggiefresh joined #scheme 2015-12-16T03:36:49Z cdidd joined #scheme 2015-12-16T03:38:44Z duggiefresh quit (Remote host closed the connection) 2015-12-16T03:50:24Z ArneBab_ joined #scheme 2015-12-16T03:53:15Z ArneBab quit (Ping timeout: 240 seconds) 2015-12-16T03:55:55Z ep quit (Quit: Connection closed for inactivity) 2015-12-16T03:57:44Z mbuf joined #scheme 2015-12-16T04:32:40Z mbuf quit (Quit: rcirc on GNU Emacs 24.5.2) 2015-12-16T04:33:11Z mbuf joined #scheme 2015-12-16T04:36:39Z neoncontrails joined #scheme 2015-12-16T05:09:42Z jcowan quit (Quit: Leaving) 2015-12-16T05:32:50Z lritter joined #scheme 2015-12-16T05:34:03Z oleo_ quit (Quit: Verlassend) 2015-12-16T06:02:38Z cjh` quit (Remote host closed the connection) 2015-12-16T06:15:55Z wattenbarger2 quit (Ping timeout: 260 seconds) 2015-12-16T06:22:44Z ecthiender joined #scheme 2015-12-16T06:25:40Z nilg joined #scheme 2015-12-16T06:29:45Z wattenbarger2 joined #scheme 2015-12-16T07:10:03Z adu joined #scheme 2015-12-16T07:48:29Z Fare quit (Quit: Leaving) 2015-12-16T07:54:06Z neoncontrails quit (Remote host closed the connection) 2015-12-16T07:55:02Z adu quit (Quit: adu) 2015-12-16T07:57:33Z nee` joined #scheme 2015-12-16T07:57:41Z ee_cc joined #scheme 2015-12-16T08:02:03Z adu joined #scheme 2015-12-16T08:04:17Z adu quit (Client Quit) 2015-12-16T08:12:01Z neoncontrails joined #scheme 2015-12-16T08:14:54Z aap_ is now known as aap 2015-12-16T08:19:56Z lambda-11235 quit (Quit: Have to write some Scheme) 2015-12-16T08:23:47Z psy_ quit (Remote host closed the connection) 2015-12-16T08:24:49Z civodul joined #scheme 2015-12-16T08:26:49Z mutbuerger joined #scheme 2015-12-16T08:29:17Z wingo joined #scheme 2015-12-16T08:54:18Z neoncontrails quit (Remote host closed the connection) 2015-12-16T08:55:20Z neoncontrails joined #scheme 2015-12-16T09:06:50Z psy_ joined #scheme 2015-12-16T09:19:51Z przl joined #scheme 2015-12-16T09:40:55Z przl quit (Ping timeout: 260 seconds) 2015-12-16T09:42:09Z przl joined #scheme 2015-12-16T09:50:56Z przl quit (Ping timeout: 256 seconds) 2015-12-16T10:12:21Z ASau quit (Ping timeout: 265 seconds) 2015-12-16T10:16:17Z przl joined #scheme 2015-12-16T10:32:28Z kephra joined #scheme 2015-12-16T10:32:29Z kraehe quit (Ping timeout: 250 seconds) 2015-12-16T10:32:40Z gravicappa joined #scheme 2015-12-16T10:33:43Z psy_ quit (Remote host closed the connection) 2015-12-16T10:40:47Z sz0 quit (Quit: Bye.) 2015-12-16T11:06:02Z micmus joined #scheme 2015-12-16T11:20:16Z neoncontrails quit (Remote host closed the connection) 2015-12-16T11:35:00Z ecthiender quit (Ping timeout: 272 seconds) 2015-12-16T11:43:47Z ee_cc quit (Quit: ee_cc) 2015-12-16T11:46:38Z neoncontrails joined #scheme 2015-12-16T11:51:14Z ecthiender joined #scheme 2015-12-16T11:56:02Z mmos joined #scheme 2015-12-16T12:14:58Z alezost joined #scheme 2015-12-16T12:19:43Z ggole joined #scheme 2015-12-16T12:23:08Z turbopape joined #scheme 2015-12-16T12:28:05Z mbuf quit (Remote host closed the connection) 2015-12-16T12:38:38Z NeverDie quit (Quit: http://radiux.io/) 2015-12-16T12:43:44Z badkins joined #scheme 2015-12-16T12:44:42Z micmus quit (Ping timeout: 255 seconds) 2015-12-16T12:54:56Z NeverDie joined #scheme 2015-12-16T12:55:11Z turtleman_ joined #scheme 2015-12-16T13:00:30Z turbopape quit (Ping timeout: 272 seconds) 2015-12-16T13:26:28Z dytrivedi joined #scheme 2015-12-16T13:27:39Z dytrivedi quit (Client Quit) 2015-12-16T13:28:30Z sz0 joined #scheme 2015-12-16T13:40:53Z spew joined #scheme 2015-12-16T13:46:55Z mmos quit (Ping timeout: 240 seconds) 2015-12-16T13:47:41Z DGASAU quit (Read error: Connection reset by peer) 2015-12-16T13:48:34Z DGASAU joined #scheme 2015-12-16T13:49:39Z neoncontrails quit (Remote host closed the connection) 2015-12-16T13:53:43Z neoncontrails joined #scheme 2015-12-16T13:57:15Z civodul quit (Read error: Connection reset by peer) 2015-12-16T13:57:40Z sz0 is now known as sz0` 2015-12-16T13:57:43Z sz0` is now known as sz0 2015-12-16T13:59:05Z civodul joined #scheme 2015-12-16T14:03:33Z duggiefresh joined #scheme 2015-12-16T14:06:22Z mbuf joined #scheme 2015-12-16T14:09:42Z spew quit (Quit: leaving) 2015-12-16T14:14:20Z ee_cc joined #scheme 2015-12-16T14:14:30Z ee_cc quit (Client Quit) 2015-12-16T14:18:14Z spew joined #scheme 2015-12-16T14:21:57Z daviid joined #scheme 2015-12-16T14:22:50Z davexunit joined #scheme 2015-12-16T14:23:28Z NeverDie quit (Quit: http://radiux.io/) 2015-12-16T14:23:41Z ecthiender quit (Quit: gotta go) 2015-12-16T14:24:06Z petercommand quit (Ping timeout: 272 seconds) 2015-12-16T14:30:08Z petercommand joined #scheme 2015-12-16T14:33:46Z duggiefresh quit (Ping timeout: 240 seconds) 2015-12-16T14:37:49Z duggiefresh joined #scheme 2015-12-16T14:38:22Z adu joined #scheme 2015-12-16T14:42:37Z ee_cc joined #scheme 2015-12-16T14:43:57Z ee_cc quit (Client Quit) 2015-12-16T14:50:15Z mmos joined #scheme 2015-12-16T14:56:23Z dytrivedi joined #scheme 2015-12-16T14:57:15Z sz0 is now known as sz0` 2015-12-16T14:57:16Z sz0` is now known as sz0 2015-12-16T14:57:45Z sz0 is now known as sz0` 2015-12-16T14:59:36Z cemerick joined #scheme 2015-12-16T14:59:57Z dytrivedi quit (Client Quit) 2015-12-16T15:03:20Z oleo joined #scheme 2015-12-16T15:03:20Z oleo quit (Changing host) 2015-12-16T15:03:20Z oleo joined #scheme 2015-12-16T15:04:17Z Steverman joined #scheme 2015-12-16T15:05:41Z nilg quit (Remote host closed the connection) 2015-12-16T15:05:52Z Mokuso joined #scheme 2015-12-16T15:07:22Z dytrivedi joined #scheme 2015-12-16T15:09:19Z jcowan joined #scheme 2015-12-16T15:14:59Z cemerick quit (Ping timeout: 246 seconds) 2015-12-16T15:19:37Z nilg joined #scheme 2015-12-16T15:23:46Z lupine joined #scheme 2015-12-16T15:26:48Z dytrivedi quit (Quit: dytrivedi) 2015-12-16T15:27:56Z lupine prepares to burn through HtDP 2015-12-16T15:28:18Z LeoNerd: Hmm? 2015-12-16T15:29:20Z daviid quit (Ping timeout: 272 seconds) 2015-12-16T15:34:16Z lupine: i've been programming professionally for a decade and still don't know a lisp. so, yeah :D 2015-12-16T15:35:31Z adu quit (Quit: adu) 2015-12-16T15:35:49Z sz0` quit (Quit: Bye.) 2015-12-16T15:36:23Z m1dnight_ quit (Quit: WeeChat 1.4-dev) 2015-12-16T15:36:41Z sz0 joined #scheme 2015-12-16T15:36:41Z m1dnight_ joined #scheme 2015-12-16T15:37:53Z m1dnight_ quit (Client Quit) 2015-12-16T15:38:10Z m1dnight_ joined #scheme 2015-12-16T15:39:26Z neoncontrails quit (Remote host closed the connection) 2015-12-16T15:42:04Z neoncontrails joined #scheme 2015-12-16T15:42:38Z sz0 quit (Quit: Bye.) 2015-12-16T15:43:43Z sz0 joined #scheme 2015-12-16T15:48:49Z aftershave joined #scheme 2015-12-16T15:50:28Z cemerick joined #scheme 2015-12-16T15:50:37Z dytrivedi joined #scheme 2015-12-16T15:52:35Z scoofy quit (Ping timeout: 276 seconds) 2015-12-16T15:54:51Z neoncontrails quit (Remote host closed the connection) 2015-12-16T15:59:47Z neoncontrails joined #scheme 2015-12-16T16:01:19Z cemerick quit (Ping timeout: 265 seconds) 2015-12-16T16:02:21Z neoncont_ joined #scheme 2015-12-16T16:02:32Z DGASAU quit (Read error: Connection reset by peer) 2015-12-16T16:03:14Z DGASAU joined #scheme 2015-12-16T16:06:04Z neoncontrails quit (Ping timeout: 256 seconds) 2015-12-16T16:08:10Z dytrivedi quit (Quit: dytrivedi) 2015-12-16T16:13:31Z dytrivedi joined #scheme 2015-12-16T16:14:00Z jcowan quit (Ping timeout: 256 seconds) 2015-12-16T16:16:29Z duggiefresh quit (Read error: Connection reset by peer) 2015-12-16T16:16:29Z duggiefr_ joined #scheme 2015-12-16T16:17:00Z mmos quit (Ping timeout: 260 seconds) 2015-12-16T16:19:57Z nilg quit (Read error: Connection reset by peer) 2015-12-16T16:20:30Z jackdaniel: lisp is a state of mind, not the programming language ;] 2015-12-16T16:27:16Z nilg joined #scheme 2015-12-16T16:30:48Z DGASAU quit (Ping timeout: 265 seconds) 2015-12-16T16:32:38Z turtleman_ quit (Quit: Leaving) 2015-12-16T16:33:53Z nee` quit (Remote host closed the connection) 2015-12-16T16:35:23Z szgyg joined #scheme 2015-12-16T16:35:56Z DGASAU joined #scheme 2015-12-16T16:41:45Z oleo: jaaa, i enjoy the borg collective too from time to time...... 2015-12-16T16:41:49Z oleo: lol 2015-12-16T16:45:27Z cousteau joined #scheme 2015-12-16T16:45:33Z DGASAU quit (Read error: Connection reset by peer) 2015-12-16T16:45:53Z cousteau: how is a vector different from a list? is it more like a C array? 2015-12-16T16:46:16Z LeoNerd: Yes 2015-12-16T16:46:30Z LeoNerd: A vector has O(1) access time for any element; but also like a C array it is a fixed length once constructed 2015-12-16T16:46:54Z LeoNerd: You can mutate the individual slots in a vector, but the length of it remains constant 2015-12-16T16:47:09Z cousteau: I see 2015-12-16T16:47:32Z micmus joined #scheme 2015-12-16T16:47:38Z cousteau: so it's an array with no fixed type (I guess scheme is kinda flexible with types in general) 2015-12-16T16:47:49Z LeoNerd: Indeed 2015-12-16T16:50:46Z cousteau: ...damn, I'm having trouble getting all this list and pair thing. I know it should be trivial but for some reason I fail to comprehend it. 2015-12-16T16:51:34Z cousteau: is a dotted pair conceptually different from a vector of length 2? 2015-12-16T16:51:39Z LeoNerd: A pair is a blob that has two little things inside it 2015-12-16T16:51:45Z LeoNerd: Not really... it could be implemented in a similar way 2015-12-16T16:52:00Z LeoNerd: The language would have to know which it was though, because (vector? (cons 1 2)) has to be false 2015-12-16T16:52:03Z davexunit: cousteau: they are fundamentally different structures, yes. 2015-12-16T16:52:11Z LeoNerd: But conceptually, a cons feels quite similar to a two-element vector 2015-12-16T16:52:16Z davexunit: sure 2015-12-16T16:52:58Z davexunit: but the similarities no longer hold when you change N 2015-12-16T16:53:38Z cousteau: ...so maybe like an int[2] vs a struct {int a; int d;}? (although those 2 are conceptually equivalent, even if they have different properties and methods) 2015-12-16T16:54:12Z davexunit: sure something like that 2015-12-16T16:54:23Z cousteau: davexunit, well yeah, but maybe you could say a pair is a subset of a vector where N=2 2015-12-16T16:54:43Z cousteau: (you could also say that an object in C is an array of 1 element... actually in some contexts it is) 2015-12-16T16:55:26Z Beluki joined #scheme 2015-12-16T16:56:16Z DGASAU joined #scheme 2015-12-16T17:03:04Z copec quit (Quit: checkity check out.) 2015-12-16T17:03:44Z nisstyre quit (Quit: WeeChat 1.3) 2015-12-16T17:03:51Z copec joined #scheme 2015-12-16T17:06:28Z duggiefr_ quit (Remote host closed the connection) 2015-12-16T17:06:37Z nilg quit (Remote host closed the connection) 2015-12-16T17:07:19Z davexunit: yes that works 2015-12-16T17:07:37Z davexunit: in practice, it would be silly to use a vector where a pair would do 2015-12-16T17:07:52Z cousteau: ok, makes sense 2015-12-16T17:08:24Z davexunit: vectors are an inherently imperative data structure 2015-12-16T17:08:36Z davexunit: whereas pairs form persistent structures 2015-12-16T17:08:39Z davexunit: like lists 2015-12-16T17:08:46Z DGASAU quit (Ping timeout: 240 seconds) 2015-12-16T17:12:42Z f-a joined #scheme 2015-12-16T17:13:45Z cousteau: hm, this tutorial seems reluctant to (define (foo x y z) ...) and instead insists in (define foo (lambda (x y z) ...)) 2015-12-16T17:13:46Z nilg joined #scheme 2015-12-16T17:13:47Z cojy: vector has to store a length so they aren't equivalent even when n=2 2015-12-16T17:15:12Z davexunit: it all depends on what we define sameness to be here 2015-12-16T17:15:21Z davexunit: we've been talking more on a conceptual level 2015-12-16T17:15:27Z aftershave quit (Quit: Textual IRC Client: www.textualapp.com) 2015-12-16T17:15:38Z davexunit: you *could* use a vector of length 2 in situations where you would use a pair 2015-12-16T17:15:49Z f-a: http://paste.lisp.org/display/219851 I have got this `factorise` function, which chokes on non-small numbers. What's the trick to speed it up? 2015-12-16T17:18:24Z f-a: or if that's too difficult to read, what's a good, efficient (possibly clearly writen)factorisation in scheme? 2015-12-16T17:18:33Z bb010g quit (Quit: Connection closed for inactivity) 2015-12-16T17:20:54Z DGASAU joined #scheme 2015-12-16T17:21:28Z wasamasa: cousteau: what if I told you that in elisp, a cons is indeed a two-element C array 2015-12-16T17:24:16Z cousteau: then I'd be very happy :) 2015-12-16T17:24:42Z dytrivedi quit (Quit: dytrivedi) 2015-12-16T17:25:04Z wasamasa: it's an implementation detail though 2015-12-16T17:25:12Z cousteau: yeah, got that :) 2015-12-16T17:25:57Z neoncontrails joined #scheme 2015-12-16T17:26:44Z neoncon__ joined #scheme 2015-12-16T17:26:54Z cousteau quit (Quit: WARNING: vhdl is not supported as a language. Using usenglish.) 2015-12-16T17:27:03Z nilg quit (Remote host closed the connection) 2015-12-16T17:27:18Z wasamasa: f-a: memoization would be such a trick 2015-12-16T17:27:30Z wasamasa: f-a: keep in mind though that it only works for pure functions 2015-12-16T17:27:57Z duggiefresh joined #scheme 2015-12-16T17:28:40Z f-a: thanks wasamasa 2015-12-16T17:28:52Z wasamasa: f-a: the prime candidate (sorry for the pun) would be the prime number generation 2015-12-16T17:29:39Z wasamasa: after all, once you know the nth prime number, you don't need to calculate it again 2015-12-16T17:29:55Z neoncont_ quit (Ping timeout: 260 seconds) 2015-12-16T17:30:14Z stepnem joined #scheme 2015-12-16T17:30:30Z neoncontrails quit (Ping timeout: 260 seconds) 2015-12-16T17:33:32Z f-a: indeed I see what you say and it should work perfectly, I'll modify the code and report back if I have further problems 2015-12-16T17:37:44Z sethalves joined #scheme 2015-12-16T17:39:31Z badkins quit (Remote host closed the connection) 2015-12-16T17:40:49Z lambda-11235 joined #scheme 2015-12-16T17:56:52Z badkins joined #scheme 2015-12-16T17:57:54Z mbuf quit (Quit: rcirc on GNU Emacs 24.5.2) 2015-12-16T17:58:31Z mbuf joined #scheme 2015-12-16T17:58:32Z badkins quit (Remote host closed the connection) 2015-12-16T17:58:47Z badkins joined #scheme 2015-12-16T17:59:01Z Steverman quit (Quit: WeeChat 1.3) 2015-12-16T18:04:49Z mbuf quit (Remote host closed the connection) 2015-12-16T18:07:26Z mbuf joined #scheme 2015-12-16T18:07:53Z jcowan joined #scheme 2015-12-16T18:08:13Z jcowan quit (Client Quit) 2015-12-16T18:08:20Z jcowan joined #scheme 2015-12-16T18:10:31Z daviid joined #scheme 2015-12-16T18:14:05Z mbuf quit (Quit: rcirc on GNU Emacs 24.5.2) 2015-12-16T18:17:39Z mbuf joined #scheme 2015-12-16T18:24:33Z mbuf quit (Quit: rcirc on GNU Emacs 24.5.2) 2015-12-16T18:25:47Z mbuf joined #scheme 2015-12-16T18:26:17Z NeverDie joined #scheme 2015-12-16T18:28:05Z mbuf quit (Remote host closed the connection) 2015-12-16T18:28:30Z mbuf joined #scheme 2015-12-16T18:30:12Z ep joined #scheme 2015-12-16T18:32:48Z wildlander joined #scheme 2015-12-16T18:35:23Z civodul` joined #scheme 2015-12-16T18:36:48Z civodul quit (Ping timeout: 256 seconds) 2015-12-16T18:38:23Z ggole quit 2015-12-16T18:45:18Z psy_ joined #scheme 2015-12-16T18:46:02Z mmos joined #scheme 2015-12-16T18:54:20Z copec quit (Remote host closed the connection) 2015-12-16T18:55:41Z mbuf quit (Quit: rcirc on GNU Emacs 24.5.2) 2015-12-16T18:56:15Z mbuf joined #scheme 2015-12-16T18:57:27Z Mokuso quit (Quit: EOF) 2015-12-16T18:59:06Z daviid quit (Ping timeout: 240 seconds) 2015-12-16T19:00:28Z copec joined #scheme 2015-12-16T19:01:16Z mbuf quit (Remote host closed the connection) 2015-12-16T19:06:09Z turtleman_ joined #scheme 2015-12-16T19:08:03Z dytrivedi joined #scheme 2015-12-16T19:10:04Z dytrivedi quit (Read error: Connection reset by peer) 2015-12-16T19:14:07Z fantazo joined #scheme 2015-12-16T19:27:22Z Beluki quit (Quit: Beluki) 2015-12-16T19:34:26Z f-a quit (Ping timeout: 272 seconds) 2015-12-16T19:39:22Z neoncon__ quit 2015-12-16T19:41:35Z turtleman_ quit (Remote host closed the connection) 2015-12-16T19:42:32Z jcowan_ joined #scheme 2015-12-16T19:45:56Z jcowan quit (Ping timeout: 256 seconds) 2015-12-16T19:51:12Z lritter quit (Remote host closed the connection) 2015-12-16T20:09:50Z ASau joined #scheme 2015-12-16T20:16:45Z oleo_ joined #scheme 2015-12-16T20:16:52Z oleo_ quit (Changing host) 2015-12-16T20:16:52Z oleo_ joined #scheme 2015-12-16T20:17:06Z oleo quit (Ping timeout: 256 seconds) 2015-12-16T20:18:06Z cjh` joined #scheme 2015-12-16T20:18:56Z bb010g joined #scheme 2015-12-16T20:19:49Z yrdz``` joined #scheme 2015-12-16T20:19:50Z sz0 quit (Quit: Connection closed for inactivity) 2015-12-16T20:20:30Z yrdz`` quit (Ping timeout: 256 seconds) 2015-12-16T20:23:35Z przl quit (Ping timeout: 240 seconds) 2015-12-16T20:27:55Z lambda-11235 quit (Quit: Have to write some Scheme) 2015-12-16T20:28:53Z daviid joined #scheme 2015-12-16T20:30:08Z Riastradh joined #scheme 2015-12-16T20:31:06Z jcowan__ joined #scheme 2015-12-16T20:34:06Z jcowan_ quit (Ping timeout: 240 seconds) 2015-12-16T20:38:42Z daviid` joined #scheme 2015-12-16T20:39:26Z daviid quit (Ping timeout: 240 seconds) 2015-12-16T20:43:27Z wildlander quit (Quit: Saliendo) 2015-12-16T20:45:17Z civodul` is now known as civodul 2015-12-16T20:47:30Z jcowan__ is now known as jcowan 2015-12-16T20:50:42Z psy_ quit (Ping timeout: 255 seconds) 2015-12-16T21:00:15Z pchrist quit (Remote host closed the connection) 2015-12-16T21:04:39Z alezost quit (Quit: I live in GuixSD and Emacs ) 2015-12-16T21:06:01Z psy_ joined #scheme 2015-12-16T21:19:54Z przl joined #scheme 2015-12-16T21:25:16Z przl quit (Ping timeout: 272 seconds) 2015-12-16T21:28:06Z fantazo quit (Ping timeout: 240 seconds) 2015-12-16T21:28:35Z gravicappa quit (Ping timeout: 240 seconds) 2015-12-16T21:39:21Z ngz joined #scheme 2015-12-16T21:54:02Z clog quit (Ping timeout: 250 seconds) 2015-12-16T22:13:06Z ngz quit (Ping timeout: 240 seconds) 2015-12-16T22:14:03Z averell quit (Remote host closed the connection) 2015-12-16T22:14:59Z szgyg quit (Ping timeout: 246 seconds) 2015-12-16T22:17:15Z przl joined #scheme 2015-12-16T22:17:24Z f-a joined #scheme 2015-12-16T22:18:41Z hiroakip joined #scheme 2015-12-16T22:22:10Z przl quit (Ping timeout: 260 seconds) 2015-12-16T22:23:20Z badkins quit (Remote host closed the connection) 2015-12-16T22:27:28Z daviid` quit (Read error: No route to host) 2015-12-16T22:27:54Z daviid joined #scheme 2015-12-16T22:33:58Z spew quit (Quit: leaving) 2015-12-16T22:34:30Z jcowan quit (Quit: Leaving) 2015-12-16T22:35:34Z davexunit quit (Quit: Later) 2015-12-16T22:35:46Z f-a quit (Ping timeout: 240 seconds) 2015-12-16T22:38:00Z f-a joined #scheme 2015-12-16T22:39:05Z daviid quit (Read error: No route to host) 2015-12-16T22:40:58Z badkins joined #scheme 2015-12-16T22:43:41Z stepnem quit (Ping timeout: 246 seconds) 2015-12-16T22:48:33Z bb010g quit (Quit: Connection closed for inactivity) 2015-12-16T22:49:13Z daviid joined #scheme 2015-12-16T23:07:10Z civodul quit (Quit: ERC (IRC client for Emacs 24.5.1)) 2015-12-16T23:07:37Z f-a: I am a bit puzzled by memoization 2015-12-16T23:07:48Z f-a: https://codeimmersion.i3ci.hampshire.edu/2009/10/09/memoization/ look at the `memoize` function 2015-12-16T23:08:30Z f-a: inside it there is a (set! memo ..etcetc.. 2015-12-16T23:10:07Z f-a: but memo is defined inside `memoize` and inside a `let`. Wouldn't it, err, die (get garbage collected?) once the function is over? 2015-12-16T23:11:37Z f-a: so say I call (memoize 8) at the beginning of my program, and them same call much later on, where is the memoised result of that call exactly stored? 2015-12-16T23:14:36Z f-a: I would have tohught of first creating a global variable (a dictionary) and then populating it 2015-12-16T23:16:15Z pjb: f-a: the function memoize returns a function (lambda args …). This function has a free variable: memo. This free variable is found in the lexical environment around this (lambda args …) function. Therefore scheme will ENCLOSE the free variable memo with the procedure (lambda args …) so that the free variable is bound at all time, when the procedure is called. 2015-12-16T23:16:22Z pjb: f-a: in short, you have a closure. 2015-12-16T23:17:02Z pjb: A closure encloses a lexical environment with a procedure having free variables, such that those free variables are bound in the enclosed lexical environment. 2015-12-16T23:17:28Z pjb: Then the closure can be called at anytime, and the lexical environment will be present. 2015-12-16T23:17:58Z przl joined #scheme 2015-12-16T23:18:12Z pjb: Notice that f, parameter of memoize is also enclosed, as well as assoc cadr apply cons list (since they are all free variables). 2015-12-16T23:22:19Z f-a: thanks pjb 2015-12-16T23:23:14Z przl quit (Ping timeout: 255 seconds) 2015-12-16T23:23:22Z pjb: f-a: notice that when implementing closures, Sussman realized that it was exactly the same code as to implement actors (objects). 2015-12-16T23:23:48Z pjb: f-a: closures and objects are equivalent, enclosing both data and code in a single entity. 2015-12-16T23:24:14Z f-a: pjb: no idea what actors or objects are though (the only language I know is haskell) :P 2015-12-16T23:24:50Z f-a: but I think I get the point 2015-12-16T23:24:51Z pjb: ok. From haskell, you already have closures, just like in maths, without realizing it. Let's say that closures just implement the normal math expectations. 2015-12-16T23:25:12Z micmus quit (Quit: Leaving) 2015-12-16T23:25:24Z f-a: pjb: I thought I know what closures where, but I never saw something like this function 2015-12-16T23:25:36Z f-a: of course, there is no set! in haskell 2015-12-16T23:26:00Z pjb: But even without sets, you can have closures, just by having embedded let in haskell. 2015-12-16T23:26:02Z lupine: I was wondering about the whole mutable thing 2015-12-16T23:26:12Z lupine: isn't that normally a bit of a no-no in functional langs? 2015-12-16T23:26:25Z pjb: Mutation is secondary here. 2015-12-16T23:26:35Z lupine: sure, I'm at a tangent 2015-12-16T23:26:41Z pjb: Well, scheme and lisp is not "purely functional". 2015-12-16T23:27:55Z mmos quit (Ping timeout: 240 seconds) 2015-12-16T23:28:00Z f-a: pjb: what I meant was that f x = (\y -> x + y) <-- this I see and understand easily (should be a closure, no?) 2015-12-16T23:28:23Z pjb: definitely, since x is a free variable of the lambda form. 2015-12-16T23:28:50Z f-a: while with scheme memoisation there was a step more in my eyes, the dictionary/hash stored somewhere 2015-12-16T23:28:54Z pjb: f 42 will return a closure with an environment where x is bound to 42. 2015-12-16T23:30:40Z lupine quit (Quit: leaving) 2015-12-16T23:31:17Z pjb: f-a: granted, the difference is that now you have mutation with set!. But the variable x in your haskell function, or the variables f and memo in memoize are the same. 2015-12-16T23:31:48Z pjb: f-a: compare f and memo: f is not mutated, but memo is mutated. Both are enclosed in the closure. 2015-12-16T23:33:05Z pjb: (define s (memoize sin)) (define c (memoize cos)) (s 4) (c 4) (s 4) will show that you have two variables f, one in s and one in c, since s compute sin while c computes cos. 2015-12-16T23:33:32Z pjb: Each closure has its own f enclosed. 2015-12-16T23:33:39Z f-a: yeah 2015-12-16T23:51:18Z lambda-11235 joined #scheme 2015-12-16T23:53:45Z clog joined #scheme 2015-12-16T23:55:15Z duggiefresh quit (Remote host closed the connection) 2015-12-16T23:55:50Z f-a quit (Ping timeout: 256 seconds) 2015-12-16T23:56:34Z duggiefresh joined #scheme