00:02:59 -!- pavelludiq [~quassel@83.222.190.105] has quit [Read error: Connection reset by peer] 00:04:29 copumpkin [~pumpkin@17.101.89.205] has joined #scheme 00:11:41 wbooze` [~user@xdsl-78-34-204-231.netcologne.de] has joined #scheme 00:13:16 homie` [~user@xdsl-78-34-204-231.netcologne.de] has joined #scheme 00:13:21 Jafet [~Jafet@unaffiliated/jafet] has joined #scheme 00:13:58 -!- homie [~user@xdsl-78-34-109-36.netcologne.de] has quit [Ping timeout: 240 seconds] 00:14:37 -!- wbooze [~user@xdsl-78-34-109-36.netcologne.de] has quit [Ping timeout: 265 seconds] 00:16:21 -!- homie` [~user@xdsl-78-34-204-231.netcologne.de] has quit [Client Quit] 00:20:03 -!- wbooze` [~user@xdsl-78-34-204-231.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 00:23:15 mmc [~michal@cs27120227.pp.htv.fi] has joined #scheme 00:24:42 homie [~user@xdsl-78-34-204-231.netcologne.de] has joined #scheme 00:27:46 wbooze [~user@xdsl-78-34-204-231.netcologne.de] has joined #scheme 00:36:14 -!- RageOfThou [~RageOfTho@users-55-161.vinet.ba] has quit [Ping timeout: 255 seconds] 00:41:50 -!- copumpkin [~pumpkin@17.101.89.205] has quit [Quit: Computer has gone to sleep.] 00:59:55 -!- pdelgallego [~pdelgalle@1503031474.dhcp.dbnet.dk] has quit [Ping timeout: 240 seconds] 01:33:10 -!- jonrafkind [~jon@crystalis.cs.utah.edu] has quit [Ping timeout: 260 seconds] 01:45:08 -!- Riastradh [debian-tor@fsf/member/riastradh] has quit [Ping timeout: 245 seconds] 01:54:00 -!- dfkjjkfd [~paulh@247-15-ftth.onsnetstudenten.nl] has quit [Quit: Lost terminal] 02:00:22 -!- borism [~boris@ec2-79-125-58-77.eu-west-1.compute.amazonaws.com] has quit [Read error: Operation timed out] 02:10:14 borism [~boris@ec2-79-125-58-77.eu-west-1.compute.amazonaws.com] has joined #scheme 02:13:27 Riastradh [debian-tor@fsf/member/riastradh] has joined #scheme 02:26:36 dnolen [~davidnole@184.152.69.75] has joined #scheme 02:29:23 -!- bgs100 [~ian@unaffiliated/bgs100] has quit [Quit: nighty night] 02:38:26 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 02:45:07 jcowan [~John@cpe-98-14-172-204.nyc.res.rr.com] has joined #scheme 02:52:35 Can anyone point me in the direction of a good tutorial on Scheme macros? 02:53:07 I mean, I've googled and found a few things, but I appreciate recommendations. :) 02:53:09 http://www.xs4all.nl/~hipster/lib/scheme/gauche/define-syntax-primer.txt 02:53:14 Thanks 02:53:23 Read it until you can't understand it any more. Then stop; you have learned all you are going to for now. 02:53:36 When you need to know more, come back and read it again from the beginning. 02:53:54 *cky* must read that. 02:54:01 jcowan: This is my outlook on life. 02:54:42 Yeah, that's been my approach to Scheme-learning 02:54:58 I originally tried to follow books through to the end, but it become less fun :\ 02:55:17 Although HTDP is an exception, I find. 02:55:20 For the most part, anyway. 02:55:26 So now I just jump around and stick with everything for as long as I can force myself to before I get onto something else 02:55:40 s/become/becomes/ 02:55:45 askhader: I skimmed The Little Schemer from front to back. 02:55:57 askhader: It's pretty neat, though I still cannot wrap my head around how to derive the Y Combinator. 02:56:00 Tried, I did read The Little Schemer all the way through :) 02:56:10 cky: Never read that, actually. I've only been through HTDP, (some of) SICP and Teach Yourself Scheme in Fixnum Days. 02:56:13 And yeah, I got a bit stuck on the last chapter 02:56:31 cky: Understandable. I'm just going to wait until I see it in class ;-) 02:56:38 askhader: :-P 02:56:42 franki^: Yeah. 02:57:22 Hmm, it looks like I just said the word "Tried" at the start of that sentence 02:57:37 I don't know where that came from, this is why I don't usually drink beer. :) 02:58:31 :-P 03:00:05 *askhader* takes another hit from the bong o.o 03:00:07 What? 03:00:21 Who? 03:01:05 republican_devil [~g@pool-173-60-208-79.lsanca.fios.verizon.net] has joined #scheme 03:01:19 what exactly is a continuation? 03:01:24 in english... 03:02:33 It's the return address as a representation of "everything we are going to do from here on" 03:03:08 Essentially, the collection of all the call frames up to the present. 03:03:10 In most languages, the continuation is implicit; procedures return to the point just after the call, but there is no way to capture this point 03:03:11 (Roughly speaking.) 03:03:34 In Scheme, you can capture the continuation as a procedure which can then be invoked at any time, including repeatedly. 03:05:39 does it take away need to handle say a web session? 03:07:21 it saves state.. 03:07:25 at a certain point 03:07:31 and can be recorded as a procedure 03:07:45 so you can use that starting point for further work? 03:07:49 In principle. But most Schemes don't allow you to serialize the continuation into a form that web browsers can handle. 03:08:02 Or any other procedure (as opposed to the *name* of a procedure) 03:08:24 there are a couple of Scheme web servers that indeed save continuations. The details are hazy to me, though. 03:10:36 Actually, http://en.wikipedia.org/wiki/Continuation is quite good, and has some links to such servers. 03:13:13 copumpkin [~pumpkin@c-66-31-44-245.hsd1.ma.comcast.net] has joined #scheme 03:17:48 The Racket server apparently fakes continuations: you need to use special procedures, rather than being able to use generic call/cc. 03:20:11 jcowan: That's bogus, those functions that you're talking about are *implemented* using continuations. 03:20:23 Real ones, even. 03:20:26 Yeah 03:20:28 ooh, fight fight 03:20:34 You can perform continuations without call/cc 03:21:21 askhader: You can? Srsly? 03:22:13 calling "fork" (or "clone") ? 03:22:36 mmc: Does that even make sense? 03:22:37 -!- xwl_ [~user@nat/nokia/x-slifofhxmmcxyxod] has quit [Remote host closed the connection] 03:22:49 The continuation becomes a paramter of the function. 03:22:58 askhader: CPS, yes. 03:23:29 askhader: But unless you write your whole program using CPS, normally, you need call/cc to actually grab the continuation. 03:23:42 Just so. 03:23:45 cky: Agreed. 03:24:06 Forking lets you do limited things to the continuation, but it doesn't capture it. 03:24:50 That's not what I'm referring to. 03:25:27 eli: So the continuation actually is serialized to the client, or only a token of it? 03:26:54 And if only a token, when and how are those tokens garbage-collected? 03:27:37 jcowan: Usually the continuation is stored in a table, and a key is sent to the client. 03:27:54 adu [~ajr@pool-173-66-11-168.washdc.fios.verizon.net] has joined #scheme 03:28:05 Right, that's what I meant by a token. When are these keys and continuations removed from the table? 03:28:06 They are collected in one of several ways, configurable as a session manager, IIRC. 03:28:13 Ah, thanks. 03:28:30 With some LRU thing being the popular one, with several other options. 03:29:02 There is also a stateless variant which is very similar, but can serialize the continuation directly to the client, with no server-side table. 03:29:30 (And that seriaization can be configured too, from naive text to encrypted form.) 03:29:35 Again, all IIRC. 03:29:53 -!- emma [~em@unaffiliated/emma] has quit [Ping timeout: 265 seconds] 03:33:31 I sketched out a design that serialized the continuation into hidden fields and then saved the whole page on the file system before delivering it. In that way, garbage collection is just file management, and the client can also save the document with the effect of saving the continuation to be restored at any time in the future (provided the server has not gone down, etc.) 03:33:50 Somewhat wasteful of disk space, but hey, it's cheap. 03:40:18 Probably easy to add. 03:42:04 It also makes the server stateless. 03:42:51 ...in an extremely stateful kind of way. 03:44:21 Well, "stateless" is generally taken to exclude externally held state. 03:44:36 as in "stateless NFS server", which does not mean that the files it serves are stateless. 03:48:49 -!- imran_sr [~imran@75-18-254-4.lightspeed.uncyca.sbcglobal.net] has quit [Quit: Leaving] 03:52:38 timj_ [~timj@e176197074.adsl.alicedsl.de] has joined #scheme 03:55:55 -!- timj__ [~timj@e176192068.adsl.alicedsl.de] has quit [Ping timeout: 240 seconds] 03:55:59 -!- kniu [~kniu@HOHOHO.RES.CMU.EDU] has quit [Ping timeout: 265 seconds] 03:58:04 Encrypted? I just skimmed through 5.0/collects/web-server and didn't see anything about encryption. 04:00:09 I did see something about affixing MACs (using HMAC-SHA1) to the serialized continuations, though, which is what matters a bit more than encryption. 04:03:04 -!- rpg [~rpg@216.243.156.16.real-time.com] has quit [Remote host closed the connection] 04:05:16 Indeed. 04:05:21 Makes them slightly more tamper-resistant. 04:11:11 kniu [~kniu@CMU-311358.WV.CC.CMU.EDU] has joined #scheme 04:15:12 -!- Kerrick [~Kerrick@b01-1.nat.iastate.edu] has quit [Quit: Kerrick] 04:16:58 `Slightly' is a slight understatement. 04:18:17 -!- tupi_ [~david@186.205.37.15] has quit [Quit: Leaving] 04:21:49 Well, depending on how good your key management is. Just a minor little detail. :-P 04:24:48 jonrafkind [~jon@jonr5.dsl.xmission.com] has joined #scheme 04:30:32 does racket intferface to redis? 04:30:36 redis seems interesting 04:31:16 If not, you can use the FFI to make an interface. 04:31:47 Interesting. 04:39:09 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving] 04:39:16 What's interesting? 04:39:30 Redis. I had never heard of it. 04:39:35 That is, what is the interesting thing that prompted your interjection? 04:39:38 OK. 04:39:46 *jcowan* wonders if the Pure community would be interested in it. 04:40:22 its a multi box in ram database that supports more than key value pairs 04:40:40 apparently fast and could potentially replace psotgresql 04:40:41 Quite. 04:40:51 Well, for some purposes, perhaps. 04:40:57 they have a twitter clone example 04:41:42 -!- MichaelRaskin [~MichaelRa@195.91.224.225] has quit [Ping timeout: 265 seconds] 04:41:47 the whole www.prevayler.org thing I find fascinating if the performance is real 04:51:57 Relational and non-relational databases really don't replace one another. 04:55:03 -!- kniu [~kniu@CMU-311358.WV.CC.CMU.EDU] has quit [Ping timeout: 240 seconds] 04:56:24 does scheme have any kind of web cache? 04:56:38 I tried squid and polipo today and boy they suck 04:58:39 vu3rdd [~vu3rdd@nat/cisco/x-ohqmzuzmbyxcpxsf] has joined #scheme 05:01:05 -!- Quadrescence [~Quad@unaffiliated/quadrescence] has quit [Quit: omghaahhahaohwow] 05:09:40 Quadrescence [~Quad@unaffiliated/quadrescence] has joined #scheme 05:12:23 schmir [~schmir@mail.brainbot.com] has joined #scheme 05:12:35 I got them going and refresh still has misses 05:12:38 really weak 05:12:45 over eingeered crud 05:12:52 MichaelRaskin [~MichaelRa@195.178.216.22] has joined #scheme 13:20:28 ccl-logbot [~ccl-logbo@setf.clozure.com] has joined #scheme 13:20:28 13:20:28 -!- names: ccl-logbot thoolihan homie` wbooze` Leonidas MrFahrenheit gravicappa drdo` hiyuh mmc alaricsp emma fradgers- jao tupi Euthydemus pdelgallego saccade ve araujo cataska danking roderic pchrist cipher dnm xwl_ tessier chandler offby1`` Dark-Star Riastradh kniu MichaelRaskin schmir Quadrescence timj_ borism Jafet wlen samth pothos Axsuul leppie firecrow8 TheRealPygo stamourv antoszka gavv\w Nshag gnomon Crito acarrico ski snorble museun rudybot alexsuraci 13:20:28 -!- names: inimino lusory necroforest pr zeroish rmrfchik nowhere_man gabot Kovensky spacebat langmartin pjb ineiros rdd Hal9k bzzbzz tizoc tonyg Zahl_ felipe mornfall Intensity ecraven eno futilius C-Keen aoh specbot yosafbridge sloyd_ jensn wgd metasyntax joast nasloc__ eldragon askhader ment preflex Khisanth mario-goulart elf Axioplase_ cky `micro stepnem Adrinael elly qebab sid3k eli sjamaan jimster jimrees_ fda314925 ray rapacity franki^ clog weinholt ToxicFrog 13:20:28 -!- names: z0d chandra foof klutometis duncanm rotty adzuci bremner Obfuscate Zol dlouhy rrm3 zbigniew certainty DerGuteMoritz shardz 13:20:53 dfkjjkfd [~paulh@145.120.22.32] has joined #scheme 13:24:16 -!- schmir [~schmir@mail.brainbot.com] has quit [Remote host closed the connection] 13:25:19 -!- alaricsp [~alaric@host86-159-57-200.range86-159.btcentralplus.com] has quit [Quit: Leaving] 13:28:40 -!- dfkjjkfd [~paulh@145.120.22.32] has quit [Quit: Lost terminal] 13:34:51 schmir [~schmir@mail.brainbot.com] has joined #scheme 13:46:41 -!- homie` [~user@xdsl-78-34-235-239.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 13:46:51 -!- wbooze` [~user@xdsl-78-34-235-239.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 13:50:58 copumpkin [~pumpkin@17.101.89.205] has joined #scheme 13:51:13 -!- copumpkin [~pumpkin@17.101.89.205] has quit [Client Quit] 13:51:38 copumpkin [~pumpkin@17.101.89.205] has joined #scheme 13:57:36 homie [~user@xdsl-78-34-235-239.netcologne.de] has joined #scheme 13:59:37 wbooze [~user@xdsl-78-34-235-239.netcologne.de] has joined #scheme 14:07:14 -!- drdo` [~user@2.208.54.77.rev.vodafone.pt] has quit [Remote host closed the connection] 14:13:10 EbiDK [~ebi@3e6b7ac3.rev.stofanet.dk] has joined #scheme 14:16:43 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 14:33:59 ski_ [~slj@c-2911e055.1149-1-64736c10.cust.bredbandsbolaget.se] has joined #scheme 14:35:31 -!- ski [~slj@c-2911e055.1149-1-64736c10.cust.bredbandsbolaget.se] has quit [Ping timeout: 240 seconds] 14:43:37 eli, in the web server, stateless refers to no server-side state 14:55:53 rpg [~rpg@216.243.156.16.real-time.com] has joined #scheme 14:58:07 -!- schmir [~schmir@mail.brainbot.com] has quit [Remote host closed the connection] 15:01:26 -!- dnm [~dnm@c-68-34-57-169.hsd1.va.comcast.net] has quit [Ping timeout: 255 seconds] 15:02:04 -!- ski_ is now known as ski 15:06:36 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Remote host closed the connection] 15:08:30 minion [~minion@common-lisp.net] has joined #scheme 15:09:20 pavelludiq [~quassel@83.222.190.105] has joined #scheme 15:12:33 pnkfelix [~Adium@c-71-225-45-140.hsd1.nj.comcast.net] has joined #scheme 15:14:12 HG` [~HG@xdsl-92-252-102-146.dip.osnanet.de] has joined #scheme 15:15:35 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 15:22:14 -!- pnkfelix [~Adium@c-71-225-45-140.hsd1.nj.comcast.net] has quit [Quit: Leaving.] 15:30:51 femtoo [~femto@95-89-197-196-dynip.superkabel.de] has joined #scheme 15:32:54 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Remote host closed the connection] 15:33:20 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 15:45:21 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Remote host closed the connection] 15:49:59 -!- offby1`` is now known as offby1 15:50:02 -!- offby1 [~user@q-static-138-125.avvanta.com] has quit [Changing host] 15:50:02 offby1 [~user@pdpc/supporter/monthlybyte/offby1] has joined #scheme 15:50:03 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 15:51:23 bweaver [~user@75-148-111-133-Chattanooga.hfc.comcastbusiness.net] has joined #scheme 15:51:41 -!- necroforest [~jarred@pool-108-18-226-169.washdc.fios.verizon.net] has quit [Read error: Connection reset by peer] 15:57:18 vu3rdd [~vu3rdd@122.167.80.25] has joined #scheme 16:03:10 samth: huh? 16:05:41 gcartier [~gcartier@modemcable026.84-70-69.static.videotron.ca] has joined #scheme 16:07:26 It also makes the server stateless. 16:07:26 ...in an extremely stateful kind of way. 16:10:33 samth: Is IO still considered state? 16:11:34 -!- bweaver [~user@75-148-111-133-Chattanooga.hfc.comcastbusiness.net] has quit [Read error: Connection reset by peer] 16:11:38 bweaver [~user@75-148-111-133-Chattanooga.hfc.comcastbusiness.net] has joined #scheme 16:14:36 -!- copumpkin [~pumpkin@17.101.89.205] has quit [Changing host] 16:14:37 copumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 16:16:43 dnm [~dnm@static-71-166-174-24.washdc.east.verizon.net] has joined #scheme 16:20:05 pygospa [~pygospa@217.191.213.34] has joined #scheme 16:20:20 -!- bweaver [~user@75-148-111-133-Chattanooga.hfc.comcastbusiness.net] has quit [Ping timeout: 255 seconds] 16:23:56 -!- TheRealPygo [~pygospa@217.191.219.144] has quit [Ping timeout: 276 seconds] 16:26:25 aisa [~aisa@173-10-243-253-Albuquerque.hfc.comcastbusiness.net] has joined #scheme 17:05:33 -!- Riastradh [debian-tor@fsf/member/riastradh] has quit [Ping timeout: 245 seconds] 17:07:25 -!- pdelgallego [~pdelgalle@1503031474.dhcp.dbnet.dk] has quit [Ping timeout: 240 seconds] 17:08:29 Fare [~Fare@ita4fw1.itasoftware.com] has joined #scheme 17:11:21 -!- jao [~jao@74.Red-80-24-4.staticIP.rima-tde.net] has quit [Ping timeout: 265 seconds] 17:14:01 eli, the only point i'm making is that this: http://docs.racket-lang.org/web-server/run.html?q=stateless#%28part._.Stateless_.Servlets%29 17:14:02 http://tinyurl.com/2547zh8 17:14:07 uses the word "stateless" 17:21:58 Caleb-- [~caleb@bzq-79-183-43-234.red.bezeqint.net] has joined #scheme 17:25:12 jonrafkind [~jon@crystalis.cs.utah.edu] has joined #scheme 17:30:05 -!- mmc [~michal@cs27120227.pp.htv.fi] has quit [Ping timeout: 240 seconds] 17:30:59 -!- gravicappa [~gravicapp@80.90.116.82] has quit [Ping timeout: 255 seconds] 17:33:59 samth: Yes, it was a joke, referring to statelessness made out of a huge amount of space stored on a stateful device. 17:34:22 ah, ok 17:57:43 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Remote host closed the connection] 17:58:36 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 18:20:45 -!- hiyuh [~hiyuh@KD124214245222.ppp-bb.dion.ne.jp] has quit [Quit: |_ e /\ \/ i |/| G] 18:21:50 -!- Intensity [xGaRhIBWkw@unaffiliated/intensity] has quit [Ping timeout: 255 seconds] 18:23:01 pdelgallego [~pdelgalle@1503031474.dhcp.dbnet.dk] has joined #scheme 18:23:05 stis [~stis@1-1-1-39a.veo.vs.bostream.se] has joined #scheme 18:23:08 -!- sloyd_ [sloyd@station457.vo3.net] has quit [Quit: ZNC - http://znc.sourceforge.net] 18:23:26 gravicappa [~gravicapp@ppp91-78-229-127.pppoe.mtu-net.ru] has joined #scheme 18:24:05 jedc [~jed@c-98-232-230-23.hsd1.or.comcast.net] has joined #scheme 18:25:25 Intensity [lmjanQeRDI@unaffiliated/intensity] has joined #scheme 18:25:34 sloyd [sloyd@station457.vo3.net] has joined #scheme 18:27:52 hi, any advice as to which class to take, machine learning or intro to logic? 18:29:28 If you have to take only one, machine learning. logic, you can learn it on the run. 18:31:39 RageOfThou [~RageOfTho@users-33-123.vinet.ba] has joined #scheme 18:34:33 Flip a coin 18:34:53 -!- MrFahrenheit [~RageOfTho@users-55-163.vinet.ba] has quit [Ping timeout: 255 seconds] 18:35:28 thanks 18:35:58 ive already taken probabilistic methods, which overlaps with machine learning a bit I think. 18:37:13 Without knowing who you are, what you want, and what those course names represent, I gave an arbitrary answer 18:37:44 But but but...flipping a coin is always the right answer!! 18:38:08 Really? Cool dude 18:38:21 SirNick [~nick@c-67-160-151-16.hsd1.wa.comcast.net] has joined #scheme 18:40:20 kar8nga [~kar8nga@k-184.vc-graz.ac.at] has joined #scheme 18:40:47 zac314159 [~user@c-68-84-149-234.hsd1.nm.comcast.net] has joined #scheme 18:40:57 That's why my parents named me "Heads" 18:41:27 Reminds me of the story about the tank image recognition algorithm 18:41:54 Wthis is the equivalent of the company having a ruling/agreement against bards informing the developer staff. 18:42:00 Oops, random pasting :| 18:42:22 More companies should have bards 18:42:48 But, what I wanted to say was "Who doesn't love an algorithm anecdote" 18:42:52 ? 18:43:14 And yes, the bards comment is a good one, from Slashdot :| 18:43:58 hi there! altogh i read the docu a many times i dont really get the difference between foldr and map. both take a proc and as second parameter a list, but foldr takes additionally a second list. would anybody be so kind and tell me how fold exactly works, maybe with a simple example with list '(1 2 3) 18:44:20 -!- Intensity [lmjanQeRDI@unaffiliated/intensity] has quit [Ping timeout: 255 seconds] 18:45:02 (fold-right + 0 '(1 2 3)) => 6, while (map + '(1 2 3)) => (1 2 3) 18:45:58 foldr does add +0 to every element and then sum it together. after that it gives the solution? 18:46:03 Zahl_: map = 1-to-1; fold = many-to-1. 18:46:12 It adds 3 to 0, then adds 2 to the result, and then adds 1 to that 18:46:14 Zahl_: Well, map = many-to-many, really, in that analogy. 18:46:30 Zahl_: But, like, each item in the input list results in one item in the output list, when you use map. 18:46:31 map just applies + to each element in the list and puts the result in another list, position-wise 18:46:57 Zahl_: But when you fold, all items in the list are condensed down to "one" value. 18:47:20 Zahl_: I say "one" because you can cons in your fold expression that effectively creates something that isn't very singular. 18:47:29 okay. i have to try that on example code. thank you for now. i think i got it 18:47:35 (map x (list a b c)) is equivalent to (list (x a) (x b) (x c)) 18:47:36 Like, you can implement reverse using fold. :-P 18:47:45 rudybot: (require srfi/1) 18:47:48 cky: your racket sandbox is ready 18:47:48 reverse, with foldl? 18:47:48 cky: Done. 18:48:20 rudybot: (define (cky-reverse l) (fold cons '() l)) 18:48:21 cky: Done. 18:48:26 rudybot: (cky-reverse '(foo bar baz)) 18:48:27 cky: ; Value: (baz bar foo) 18:48:33 Zahl_: ^^--- 18:48:52 oh :-) 18:51:09 Zahl_: Usually, I prefer to fold left rather than fold right, because fold left is iterative. 18:51:26 Zahl_: Similarly, I prefer to unfold right rather than unfold left, because a right unfold is iterative. 18:52:31 (fold-right x y (list a b c)) is equivalent to (x a (x b (x c y))). As you can see it has to recur down the list and compute (x c y) first, then work its way back up to the start of the list 18:52:55 What sjamaan said. 18:54:07 (fold x y (list a b c)) is equivalent to (x c (x b (x a y))). There it can start with the inner computation, and work down the list without needing anything but the last call's result 18:57:12 -!- rpg [~rpg@216.243.156.16.real-time.com] has quit [Quit: rpg] 18:58:21 (define (fold-right f z xs) (fold (lambda (z x) (f x z)) z (reverse xs))) 19:01:26 yeah, and you can implement reverse with set-cdr! and such to make it iterative, right? 19:02:21 oh you don't even need that. nevermind 19:03:14 sjamaan: Nope, see my example above. :-) 19:03:24 :) 19:03:43 fold (or fold-right) are primitive recursive, too 19:04:05 Magic sledgehammer 19:05:23 femtooo [~femto@95-89-197-196-dynip.superkabel.de] has joined #scheme 19:06:03 Zahl_: More fun with fold and unfold: you can implement map with both! http://paste.lisp.org/display/116724 19:06:27 hehe 19:06:37 Poor Zahl_'s head probably exploded 19:06:38 It won't save space though -- in fact if conses use more space than the function stack, it'll use more 19:06:53 (Implementing fold-right in terms of fold) 19:07:02 sjamaan: :-) 19:07:44 -!- jedc [~jed@c-98-232-230-23.hsd1.or.comcast.net] has quit [Quit: Leaving] 19:08:53 -!- femtoo [~femto@95-89-197-196-dynip.superkabel.de] has quit [Ping timeout: 276 seconds] 19:11:15 concore [~user@189-015-102-219.xd-dynamic.ctbcnetsuper.com.br] has joined #scheme 19:11:36 Zahl_: Slightly less head-explody: http://paste.lisp.org/display/116724#1 19:11:42 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Ping timeout: 265 seconds] 19:15:31 ah, you meant unfold. okay. but i have another question. i have (foldr (THIS ONE) '(1 2 3)). in this snippet "THIS ONE" only gets applied once to my first element, according to 19:46 < sjamaan> It adds 3 to 0, then adds 2 to the result, and then adds 1 to that 19:16:03 Zahl_: No, I didn't mean unfold. 19:16:16 Zahl_: There are two varieties of fold: left fold and right fold. 19:16:20 Zahl_: fold-right takes three arguments, not two 19:16:27 Zahl_: There are also two varieties of unfold: left unfold and right unfold. 19:16:45 yes. i mean THIS ONE with '+ 0', sorry 19:16:46 Zahl_: In the case of fold, if the iteration order doesn't matter, then prefer to use left fold. 19:17:13 Zahl_: It gets applied once to 1, but the result of that is passed on the second call 19:17:21 Zahl_: In the case of unfold, if the construction order doesn't matter, then prefer to use right unfold. 19:17:29 cky: ill try to concentrate on understanding foldr first :-P 19:17:36 Zahl_: No, please focus on foldl. 19:17:41 Forget foldr unless you must. 19:18:14 Zahl_: Sorry, I made a mistake. It gets applied once to 1. That's correct. That's the last call it makes; 1 and the result of (fold-right + 0 '(2 3)) 19:19:42 i wanted to use folr because of all examples i got here are based on foldr 19:19:55 fold is more common I think 19:20:03 sjamaan: 100% agree. 19:20:18 That's why I was trying to wean Zahl_ of the fold-right obsession. 19:20:51 so sjamaan, in the case of (foldr + 0 '(1 2 3)) first 1 +0 = 1 second: result of first + 2 third: resuld from second +3? 19:21:11 No, that's what fold-left does 19:21:20 fold-right starts at the right. Hence its name 19:21:34 It does (+ 3 0), then (+ 2 3) and then (+ 1 5) 19:21:38 sjamaan++ 19:21:38 okay but the principe is right? 19:21:42 The result of the latter is returned 19:22:05 Zahl_: No, the principle you described is that of fold-left 19:22:25 (and not exactly; the order of the arguments to the proc is swapped) 19:22:27 Zahl_: Please learn fold-left first. You will find it easier to work with. 19:22:38 Zahl_: fold-right is for more esoteric uses. 19:22:39 yes i get what your point is. the order was wrong 19:23:27 i dont have a "fold" binding in my scheme. so i think when you say use fold you mean foldl? 19:23:33 Yes. 19:23:50 ah ic 19:23:56 fold and fold-right are names from SRFI 1. 19:23:57 fold is the typical name of this operation in Scheme 19:24:03 What sjamaan said. 19:24:15 Or did they rename it with r6? 19:24:23 Better not have. :-P 19:24:54 specbot: r6rs fold-left 19:25:02 meh 19:25:08 They did rename it. to fold-left 19:25:36 yay for symmetry 19:25:41 heh 19:25:44 Heh. 19:29:31 and can i do something like (define (ad x y)(+ x y) (fold ad '(1 2 3)) it works fine with map. but doesnt with fold. okay i know map supplies only one argument when fold needs two but i think something similar just has to work. but if i issue this i get an error that i only give 2 arguments 19:30:23 Zahl_: map just calls a function on each element in a list and produces a new list of equal length with each item replaced by the result of calling the function on that item 19:30:28 i think i havent adaptet the nature of functional programming yet 19:30:36 -!- homie [~user@xdsl-78-34-235-239.netcologne.de] has quit [Read error: Operation timed out] 19:30:57 |19:45| ( sjamaan) (map x (list a b c)) is equivalent to (list (x a) (x b) (x c)) 19:32:12 homie [~user@xdsl-78-34-235-239.netcologne.de] has joined #scheme 19:34:16 how map works is becoming clear to me. but i want something instead of using static (fold>> + 0<< 19:34:52 Zahl_: What do you want to do? 19:36:02 because i think its now only that fold can add some numbers like we saw above (fold + 0 list). i want something to do instead. i dont know exactly what but there must be a thing to do. or is fold only for adding numbers 19:36:46 sorry i cannot exactly describe my question. its just a question of cases where i could use fold and where i have to use map 19:37:15 i dont really see a sense of using fold 19:37:51 but i know it must be often used by people otherwise it wouldnt be in the scheme standards 19:38:14 Zahl_: "fold is the fundamental iteration operation." 19:38:16 Zahl_: You can use fold whenever you need to produce a single value from a list of things 19:38:47 (or even when you need a new list that can be derived by looping over the list, as seen by the fold-based REVERSE implementation) 19:39:22 okay. for example when i got a list '(abc def) and i want to get a single string of it like "abc def" i would use fold? 19:39:31 sure. Use it with string-append 19:39:41 -!- MichaelRaskin [~MichaelRa@195.178.216.22] has quit [Remote host closed the connection] 19:40:07 Zahl_: Sure. (fold (compose string-append symbol->string) "" '(abc def)) 19:40:18 Zahl_: (That will get you "abcdef" not "abc def". You'll live.) 19:40:19 oh it was symbols 19:40:20 Sure 19:41:04 Riastradh [debian-tor@fsf/member/riastradh] has joined #scheme 19:41:10 ah the main difference between both is list output vs single output 19:41:17 More or less 19:41:26 You can produce lists or other complex values with fold too 19:41:35 Just use cons 19:41:40 And '() as starting value 19:42:22 fold = list -> anything-that-can-be-build-piecemeal 19:42:26 *built 19:43:11 i understand 19:44:31 Zahl_: As a practical example, a directory handler in a webserver I've written uses fold to create a HTML string containing links to directory entries from a list of filename-entries 19:46:19 i tried that string-append example and it workes like a charm 19:47:27 Yay! 19:54:44 *Caleb--* creates a VB GUI to track cky's IP Address 19:54:58 Caleb--: Why are you going to do that? 19:55:06 to catch you! 19:55:12 But what for? 19:55:24 for the crimes you have committed 19:55:27 ?!! 19:55:33 What crimes?! 19:55:57 crimes again hoomanity. 19:56:04 cky, http://www.youtube.com/watch?v=hkDD03yeLnU 19:56:19 -!- femtooo [~femto@95-89-197-196-dynip.superkabel.de] has quit [Quit: Leaving] 19:56:21 Lol, nice. 19:57:02 that show makes me sick 19:57:41 *Caleb--* gets back to calculus 19:58:44 I bet. 20:06:26 -!- tessier [~treed@mail.copilotco.com] has quit [Changing host] 20:06:27 tessier [~treed@kernel-panic/copilotco] has joined #scheme 20:11:18 jewel [~jewel@196-215-88-116.dynamic.isadsl.co.za] has joined #scheme 20:18:19 -!- jewel [~jewel@196-215-88-116.dynamic.isadsl.co.za] has quit [Ping timeout: 240 seconds] 20:19:47 -!- concore [~user@189-015-102-219.xd-dynamic.ctbcnetsuper.com.br] has left #scheme 20:23:40 -!- thoolihan [~Tim@209.221.3.130] has quit [Quit: Leaving] 20:46:40 -!- HG` [~HG@xdsl-92-252-102-146.dip.osnanet.de] has quit [Quit: Leaving.] 20:46:56 -!- wbooze [~user@xdsl-78-34-235-239.netcologne.de] has quit [Remote host closed the connection] 20:46:56 -!- homie [~user@xdsl-78-34-235-239.netcologne.de] has quit [Read error: Connection reset by peer] 20:48:06 adu [~ajr@pool-173-66-11-168.washdc.fios.verizon.net] has joined #scheme 20:56:18 -!- SirNick [~nick@c-67-160-151-16.hsd1.wa.comcast.net] has quit [Ping timeout: 265 seconds] 21:05:57 homie [~user@xdsl-78-34-235-239.netcologne.de] has joined #scheme 21:06:32 -!- pdelgallego [~pdelgalle@1503031474.dhcp.dbnet.dk] has quit [Ping timeout: 272 seconds] 21:06:41 MichaelRaskin [~MichaelRa@195.91.224.225] has joined #scheme 21:08:05 bgs100 [~ian@unaffiliated/bgs100] has joined #scheme 21:10:33 wbooze [~user@xdsl-78-34-235-239.netcologne.de] has joined #scheme 21:10:37 SirNick [~nick@69.166.35.201] has joined #scheme 21:10:41 -!- SirNick [~nick@69.166.35.201] has quit [Remote host closed the connection] 21:13:37 -!- firecrow8 [~fcrow@69.38.169.34] has left #scheme 21:23:29 -!- gravicappa [~gravicapp@ppp91-78-229-127.pppoe.mtu-net.ru] has quit [Ping timeout: 250 seconds] 21:28:31 -!- kar8nga [~kar8nga@k-184.vc-graz.ac.at] has quit [Remote host closed the connection] 21:30:24 bweaver [~user@75-148-111-133-Chattanooga.hfc.comcastbusiness.net] has joined #scheme 21:37:55 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Ping timeout: 240 seconds] 21:38:29 copumpkin [~pumpkin@17.101.89.205] has joined #scheme 21:38:29 -!- copumpkin [~pumpkin@17.101.89.205] has quit [Changing host] 21:38:29 copumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 21:45:20 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Ping timeout: 260 seconds] 21:45:20 pumpkin [~pumpkin@17.101.89.205] has joined #scheme 21:45:20 -!- pumpkin [~pumpkin@17.101.89.205] has quit [Changing host] 21:45:20 pumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 21:49:48 davazp [~user@83.46.0.16] has joined #scheme 21:50:15 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 21:51:34 -!- EbiDK [~ebi@3e6b7ac3.rev.stofanet.dk] has quit [Quit: Ex-Chat] 21:57:35 -!- fradgers- [~fradgers-@5e064cc1.bb.sky.com] has quit [Remote host closed the connection] 22:01:44 -!- gcartier [~gcartier@modemcable026.84-70-69.static.videotron.ca] has quit [Read error: Connection reset by peer] 22:08:03 -!- langmartin [~user@exeuntcha2.tva.gov] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 22:14:44 -!- zac314159 [~user@c-68-84-149-234.hsd1.nm.comcast.net] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 22:24:31 schmir [~schmir@p54A9150B.dip0.t-ipconnect.de] has joined #scheme 22:25:39 nowhereman [~pierre@AStrasbourg-551-1-11-59.w86-213.abo.wanadoo.fr] has joined #scheme 22:26:29 -!- nowhere_man [~pierre@AStrasbourg-551-1-98-163.w90-13.abo.wanadoo.fr] has quit [Ping timeout: 276 seconds] 22:27:10 jao [~jao@83.32.170.229] has joined #scheme 22:28:00 -!- pumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Ping timeout: 245 seconds] 22:45:46 -!- aisa [~aisa@173-10-243-253-Albuquerque.hfc.comcastbusiness.net] has quit [Quit: leaving] 22:53:35 Azuvix [~Azuvix@174-27-51-173.bois.qwest.net] has joined #scheme 22:53:58 copumpkin [~pumpkin@17.101.89.205] has joined #scheme 22:53:58 -!- copumpkin [~pumpkin@17.101.89.205] has quit [Changing host] 22:53:58 copumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 22:58:08 rpg [~rpg@216.243.156.16.real-time.com] has joined #scheme 23:11:24 -!- stis [~stis@1-1-1-39a.veo.vs.bostream.se] has quit [Remote host closed the connection] 23:12:29 -!- schmir [~schmir@p54A9150B.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 23:16:04 zac314159 [~user@c-68-84-149-234.hsd1.nm.comcast.net] has joined #scheme 23:39:45 -!- jao [~jao@83.32.170.229] has quit [Remote host closed the connection] 23:41:18 -!- Azuvix [~Azuvix@174-27-51-173.bois.qwest.net] has quit [Quit: Leaving] 23:46:36 -!- pavelludiq [~quassel@83.222.190.105] has quit [Read error: Connection reset by peer] 23:47:19 -!- zac314159 [~user@c-68-84-149-234.hsd1.nm.comcast.net] has quit [Remote host closed the connection] 23:54:54 davazp` [~user@36.Red-79-153-149.dynamicIP.rima-tde.net] has joined #scheme 23:56:59 -!- davazp [~user@83.46.0.16] has quit [Ping timeout: 276 seconds] 23:59:02 -!- Fare [~Fare@ita4fw1.itasoftware.com] has quit [Quit: Leaving]