00:05 (join) jonrafkind 01:14 (join) vu3rdd 03:20 (quit) jonrafkind: Ping timeout: 240 seconds 03:32 (quit) Lajla: Read error: Connection reset by peer 03:33 (join) Lajla 04:26 (join) masm 05:11 (quit) jao: Ping timeout: 245 seconds 06:01 (join) jao 07:40 (quit) jao: Ping timeout: 265 seconds 08:30 (quit) rbarraud__: Read error: Operation timed out 08:31 (join) jao 08:51 (join) confounds 08:56 (join) scifi 08:57 scifi: hey all 08:57 scifi: im working with old DrScheme 08:57 scifi: due to university 08:57 scifi: policy 08:57 scifi: im just asking is there any documentation 08:57 scifi: related to old scheme 08:58 scifi: still available for me to look at 09:00 scifi: ok tx anyways 09:30 confounds: scifi: there must be somewhere online 09:35 (nick) samth_away -> samth 09:35 samth: scifi, documentation should have come with the system 09:36 samth: what happens when you go to the HelpDesk from DrScheme? 09:36 samth: scifi: here's all the old documentation: http://download.plt-scheme.org/doc/ 09:39 samth: eli, that page i just mentioned should be linked from the racket site 09:45 eli: samth: Behind you!! There's a giant pink elephant! 09:48 samth: eli, what? 09:48 samth: all I see is Vincent 10:03 (join) fjl 10:03 Lajla: scifi, universities,t hey all try you to get to scheme. 10:03 scifi: well 10:04 scifi: its a course 10:04 Lajla: scifi, what'sit called? 10:04 scifi: i must do it in scheme 10:04 Lajla: Ahaha 10:04 Lajla: So many people come here saying they don't get Scheme and hate it but have to do so by their university. =) 10:07 scifi: well 10:07 scifi: im here 10:07 scifi: to get some help 10:07 scifi: do you know 10:07 scifi: where the documentation is 10:08 scifi: the old one 10:08 scifi: actualy i think scheme for people that already know C and C++ is useless 10:08 scifi: but for newcomers is great 10:09 Lajla: scifi, you mean a documentation on Scheme. 10:09 Lajla: R5RS scheme standard? 10:10 Lajla: Or R4RS? 10:10 scifi: y 10:10 bremner: scifi: didn't you see samth pointed you to http://download.plt-scheme.org/doc/ 10:10 Lajla: scifi, I actually think that learning scheme is like learning Latin, not much use on its own, but it greatly improves your understanding of other languages because traces of Latin ended up at all places. 10:10 Lajla: bremner, I'm not quite sure he means that. 10:10 Lajla: I think he just means specs on Scheme. 10:10 scifi: ah no didnt see it 10:10 Lajla: As in, Scheme 10:10 scifi: thanks bremner 10:11 (nick) confounds -> confounds_afk 10:11 bremner: Lajla: no, he's crazy in a different way than you, it turns out :) 10:12 Lajla: bremner, you mean because I use R5RS? 10:12 bremner: nah, just a random remark 10:12 Lajla: I don't really like to make my code so that there exists only one compiler that compiles it. 10:12 bremner: also the clickwheel story 10:12 Lajla: bremner, ahh, not sure if it was you, but I once debated a point here why I used R5RS 10:13 Lajla: Do not mess with the clickwheel. 10:13 bremner: it wasn't me, I'm not knowledgeable enough to debate that 10:13 Lajla: All my sentences are just a few thousand spins away 10:13 Lajla: bremner, neither am I. 10:13 Lajla: But when chandler is not around, I can praetend that I am. 10:13 samth: Lajla, learning R5RS may be like learning Latin, but here in #racket, we're learning a very live language 10:13 scifi: racket is better than scheme 10:13 scifi: imo 10:14 scifi: scheme is getting old 10:14 bremner: like C? 10:14 scifi: it is old 10:14 scifi: y 10:14 scifi: C is old 10:14 scifi: to 10:14 scifi: C++ pythin all the way 10:14 scifi: #python 10:14 scifi: C is like fortran with new grammar 10:15 Lajla: Fortran is like fortran with new grammar. 10:15 scifi: : ) 10:15 Lajla: The point is that C is designed as a portable assembly, and still fulfills that purpose adequately. 10:15 Lajla: But many people try to use it as a high level langauge. 10:15 Lajla: Things like algol or APL already existed for that purpose before scheme. 10:15 Lajla: before C* 10:15 scifi: y 10:16 Lajla: scifi, because most people only know C and the name is just very popular, a lot of people make stuff in the wrong language than they should. 10:16 scifi: y 10:16 scifi: i agree 10:16 Lajla: samth, well, I used R5 practically actually. 10:17 Lajla: What I also found hilarious was that one time when someone who accused python of being slow and used C for speed, some other guy managed to make a python program that did the same but faster. 10:17 scifi: hahaha 10:17 Lajla: Of course, if his algorithms were ported to C, it would be even faster. 10:17 scifi: well you know 10:17 Lajla: But it was just sooo pwned. 10:17 scifi: C and C++ were made to be more functional 10:18 scifi: still got to love #lua 10:18 scifi: brazzilian python 10:18 scifi: ftw 10:18 Lajla: C was actually not made to be functional at all, C was made to painstakingly write operating systems and firmware in. 10:19 Lajla: While all 'programs' as in not 'stuff that controls machine on a low level but tools and automations' at the time of C were already written in higher level languages. 10:19 scifi: still i think C++ is the best all round language 10:19 Lajla: Why? 10:19 scifi: it may not be the BEST language 10:19 Lajla: C++ basically nowadays no longer is intended for low level use and its C heritage limits it in that. 10:19 scifi: but its the most used 10:19 scifi: you can find tons of ciomunities 10:19 (join) MayDaniel 10:19 scifi: working on it 10:20 Lajla: A lot of C++ functions are just statically botched onto rewriting it to C and it shows in some places. 10:20 scifi: #comunities 10:20 Lajla: I think Java does the same better, which started all over with the same goal, or D maybe. 10:21 scifi: as i said it may not be the best language 10:21 scifi: but its the most widely used 10:21 scifi: and just for that 10:21 scifi: you can learn it better 10:21 Lajla: Or worse, there are a lot of C++ tutorials out there made by people who don't know what they're talkinga bout. 10:22 scifi: yep that too 10:22 scifi: but take for example racket 10:22 Lajla: Any Scheme litature is generally written by people who know what they talk about. 10:22 scifi: can be great sometimes 10:22 scifi: but where is it used 10:22 Lajla pats samth on the head. 10:22 scifi: you cant find that many aplications 10:22 scifi: that use it 10:22 scifi: and its great 10:22 Lajla: scifi, well, some web servers run on scheme, some CGI movies were made using scheme, google users scheme, I think twitter also users scheme internally. 10:23 scifi: yeah sure 10:23 Lajla: I'm currently starting a new webcomic, and the back and runs on scheme using a tripple-database 10:23 scifi: i know but most people use c and java for that 10:23 Lajla: But it's vicious, C++ nowadays is basically a timebomb, you can see that it's botched onto C at a lot of places, you can continue it or start over. 10:23 Lajla: Java is a danger to others and to itself. =) 10:24 Lajla: I don't know, there's just some-thing about the sentence 'I'm a java programmer' that makes me shrivel. 10:24 scifi: lol 10:24 scifi: hahaha 10:25 Lajla: http://en.wikipedia.org/wiki/Talk:Type_polymorphism#Way_too_complex_article.21.21 I mean like this. =( 10:25 (notice) rudybot: http://tinyurl.com/2w7un9a 10:25 Lajla: This is sooo stereotypically java 10:25 Lajla: Ohhh 10:25 Lajla: rudybot, automatically tinyurls it for me? 10:25 rudybot: Lajla: synx`: you mean rudybot's tinyurls ? offby1's got some standardese on his side that bots are supposed to use notices for that sort of thing :/ 10:26 Lajla: Cute, but utterly useless 10:28 (join) hanDerPeder 10:29 scifi: well python and lua are fairly used 10:29 scifi: python is an evolving comunity 10:30 scifi: still i doubt languages sutch as scheme and racket will get new people, maybe new languages will apear 10:30 scifi: open source projects 10:30 Lajla: Well, I'm myself 21 years old. 10:30 Lajla: I'm certainly not an old rot. 10:30 Lajla: I just like scheme. 10:30 scifi: sorry if i called you old 10:30 scifi: :P 10:31 scifi: but what i ment was 10:31 Lajla: Stallman aparently was also introduced to lisp when he was young and was amazed that such a alanguage could exist. 10:31 Lajla: Same here. 10:31 scifi: getting like more 10:31 scifi: than 300 newcomers 10:31 scifi: up to 1000 programmers 10:31 scifi: dont get me wrong its a nice language 10:31 scifi: and better than some others 10:31 scifi: that exist out there 10:31 scifi: but still 10:32 scifi: well anyways thanks one more time for the documentation 10:35 Lajla: I didn't give it, I was too weird. =( 10:36 Lajla: But yeah, Scheme is a pretty obscure language. 10:36 Lajla: I guess most people like to infix their operators. 10:36 Lajla: I also like how clojure blurrs the line between value and function. 10:36 Lajla: Whre you can index your vectors by (random-vector 4) or some thing like that. 10:37 Lajla: Or your hashtables like (random-hashtable :random-key) 11:23 (quit) vu3rdd: Remote host closed the connection 11:51 (join) ttuttle 11:51 ttuttle: If I define a struct in Racket, is there an easy way for the module I define it in to provide all of the generated functions without listing them by hand? 11:53 offby1: yeah 11:53 offby1: there's a special provide form for structs, if I recall correctly. 11:53 ttuttle: ah, struct-out 11:53 ttuttle: thanks! 11:53 offby1: ayup 11:53 (join) sstrickl 11:55 ttuttle: also, I'm sure you hear this all the time 11:55 ttuttle: but racket is the best language I've ever used. 11:56 jay-mccarthy: thanks ttuttle 11:56 (quit) sstrickl: Client Quit 11:56 (join) sstrickl 11:57 (nick) confounds_afk -> confounds 12:12 ttuttle: what is the easiest way to check if a predicate is true for every item in a list? (I am trying to check if two lists of strings are equal.) 12:12 ttuttle: I found for-all, but it's from r6rs, not racket. 12:14 jay-mccarthy: andmap 12:14 ttuttle: thanks! 12:22 (join) jonrafkind 12:44 (join) Fare 12:46 (quit) scifi: Quit: Page closed 13:28 (quit) hanDerPeder: Quit: hanDerPeder 13:31 (nick) confounds -> phenni 13:36 (join) hanDerPeder 13:39 (quit) hanDerPeder: Client Quit 13:40 (join) carleastlund 14:42 (quit) phenni: Remote host closed the connection 15:19 (join) hanDerPeder 15:27 (join) scifi 15:31 (join) wingo 15:32 wingo: evening, racketeers 15:52 (join) freakazoid 15:56 samth: evening, wingo 15:56 samth: well, afternoon here 15:57 wingo: :) 16:02 (join) mceier 16:17 (join) _ryanc_ 16:25 (quit) stamourv: Remote host closed the connection 16:25 (quit) wingo: Ping timeout: 245 seconds 17:02 (quit) scifi: Quit: Page closed 17:03 (quit) MayDaniel: Read error: Connection reset by peer 17:15 jay-mccarthy: anyone know of a good portable thing like $$ in racket? 17:16 Fare: what is $$ ? 17:16 jay-mccarthy: the pid in sh 17:16 jay-mccarthy: i'm wondering how to get a pid in a nice rackety way 17:16 Fare: portable - unix and windows? 17:17 jay-mccarthy: ya 17:17 jay-mccarthy: does that even exist on windows? 17:19 freakazoid: yes pid exists on windows 17:24 jonrafkind: (getpid) exists, so i imagine its just an oversight that getparentpid doesnt exist 17:24 jay-mccarthy: getpid exists? 17:24 jonrafkind: http://docs.racket-lang.org/mzlib/mzlib_os.html?q=pid&q=process#(def._((lib._mzlib/os..rkt)._getpid)) 17:24 jay-mccarthy: ah 17:25 jonrafkind: you want pid, not parent pid? 17:25 jay-mccarthy: ya 17:47 (part) freakazoid 17:55 (quit) sstrickl: Quit: sstrickl 18:52 (join) kingless 18:54 (quit) kingless: Remote host closed the connection 19:33 (nick) samth -> samth_away 19:39 ttuttle: As a rather new Racket programmer, do I need to worry about the difference between wrap-evt and handle-evt? 19:40 jonrafkind: probably not 19:41 ttuttle: Okay, cool. 19:41 ttuttle is using handle, for no particular reason. 19:42 (quit) _ryanc_: Quit: Leaving 19:56 (quit) masm: Quit: Leaving. 19:58 (join) confounds 20:14 (quit) mceier: Quit: leaving 20:18 (quit) hanDerPeder: Quit: hanDerPeder 20:20 (join) acts_as_david 20:35 (quit) jonrafkind: Ping timeout: 265 seconds 20:45 (quit) Parkotron: Remote host closed the connection 20:49 (quit) acts_as_david: Quit: acts_as_david 20:52 (join) kingless 20:53 (join) rbarraud__ 20:56 (quit) kingless: Client Quit 20:57 (join) kingless 21:05 (quit) carleastlund: Quit: carleastlund 21:07 (quit) kingless: Ping timeout: 265 seconds 21:09 (join) hanDerPeder 21:09 (quit) hanDerPeder: Client Quit 21:18 (join) kingless 21:23 (join) writer 21:24 (quit) kingless: Ping timeout: 264 seconds 21:31 (quit) rbarraud__: Ping timeout: 265 seconds 21:58 (join) rbarraud 22:03 (quit) confounds: Remote host closed the connection 23:11 (join) Misterpond 23:11 Misterpond: can someone help me with DrRacket? 23:12 Misterpond: regarding lists? 23:13 (join) hehe 23:13 Misterpond: lol 23:13 (quit) hehe: Client Quit 23:15 Misterpond: HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 23:16 offby1 plugs ears 23:16 Misterpond: :( 23:16 Misterpond: can you help? 23:16 rudybot: Ask yer question 23:16 Misterpond: if I have a number, how do I make a list out of it? 23:16 offby1: rudybot: eval (list 123) 23:17 rudybot: *offby1: your scheme sandbox is ready 23:17 rudybot: *offby1: ; Value: (123) 23:17 offby1: that's the obvious way 23:17 offby1: or did you mean a list of all its digits? 23:17 Misterpond: The assignment is to use two functions that will find the number of heads generated by flipping a coin 100 times. 23:17 Misterpond: The first function, the struggle-fest, is suppose generate a list of random combination (the values in the list can only either be 1 or 0 (random 2)). 23:21 Misterpond: is this hopeless? 23:21 Misterpond: is there even anyone here? 23:22 offby1: that should be easy. 23:22 offby1: do you know how to generate _one_ random number? 23:22 offby1: rudybot: eval (random 2) 23:22 rudybot: *offby1: ; Value: 1 23:22 Misterpond: yeah 23:22 offby1: oops, I gave it away 23:22 Misterpond: haha 23:22 Misterpond: but I don't know what to do with it? 23:22 offby1: do you know how to do one thing a bunch of times, and accumulate the results in a list (this is probably the gist of the lesson)? 23:22 Misterpond: no 23:22 offby1: aha! 23:22 offby1: let's figure that out, then. 23:23 offby1: Are you forced to use one of those student languages, or can you use plain ol' racket? 23:23 (join) GOOD 23:23 Misterpond: student 23:23 offby1: hm 23:23 offby1: not sure what features that language has :-| 23:23 offby1: well, surely they've already taught you about _some_ functions that return lists of stuff. Can you remember any of them? 23:24 offby1: maybe one of them will be useful 23:24 (quit) GOOD: Client Quit 23:24 Misterpond: we've learned about functions 23:24 offby1: talk about recursion any, or looping? 23:24 Misterpond: and by we I mean everyone around me 23:24 offby1: :) 23:24 Misterpond: yeah the first ___ rest ___ thing? 23:24 (join) Goodnewseveryone 23:25 Misterpond: i only know how do loop with lists 23:25 offby1: hmm 23:25 Misterpond: the contract is :toss-coin: num(random 2) --> list of number 23:26 Misterpond: right now, I have 23:26 Misterpond: (define (toss-coin num) 23:26 Misterpond: (cond 23:26 offby1: tell me if this sort of thing looks familiar: 23:26 offby1: rudybot: eval (let loop ((pets (list 'cat 'dog 'hamster)) (result '())) (if (null? pets) result (loop (cdr pets) (cons (cons "I want a" (car pets)) result)))) 23:26 rudybot: *offby1: ; Value: (("I want a" . hamster) ("I want a" . dog) ("I want a" . cat)) 23:27 Misterpond: I'm gonna be honest with you. That looks like chinese to me 23:27 Misterpond: the cons looks famillar 23:27 Goodnewseveryone: I have a dire dilemma 23:28 Goodnewseveryone: should I subscribe to National Geographic ($15/year) or MIT's Technology Review ($25/year)? 23:28 offby1: Misterpond: you'll probably want to /ignore Goodnewseveryone ; I just did 23:29 Misterpond: Thank you 23:29 offby1: part of the reason it looks bad is that I've had to crush out all the indentation, in order to feed it to the bot. 23:29 Misterpond: the thing is...I don't even know what my variable in this funciton is 23:30 offby1: http://gist.github.com/612764 is the same thing, formatted nicer 23:30 Misterpond: I'm not even sure if I have a variable anymore.... 23:30 Goodnewseveryone: this community is shockingly elitist 23:30 Goodnewseveryone: and here I'd expected better 23:30 Lajla hugs all peope in the channel. 23:30 offby1: Lajla: hug Goodnewseveryone 23:30 Misterpond: the cons looks famillar, the condition (if/then) seems famillar 23:30 offby1: good, good 23:31 offby1: is the "let" with a name after it ("loop" in my case) famillar? 23:31 Misterpond: no 23:31 offby1: I'm trying to guess what you've been taught, and thus what tools you're allowed to work with 23:32 Goodnewseveryone: or she could just tell you 23:32 Goodnewseveryone: and save you the trouble of guessing 23:32 Misterpond: We've done basic things with lists basic structure (although I don't think that applies) 23:32 Lajla: Misterpond, actually, a simple way to do this is: (map random (make-list 2 100)) 23:32 offby1: it probably does, actually. 23:32 Misterpond: um...conditions with lists 23:32 Lajla: But offby1 doesn't tell you this because he thinks you're a noob. 23:32 Misterpond: oh 23:32 offby1: no, because I fear he's not yet allowed to use "make-list", and anyway, I prefer "build-list" :) 23:32 offby1: rudybot: eval (build-list 50 (lambda (ignored) (random 2))) 23:32 rudybot: *offby1: ; Value: (0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 1 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 0 0 1 1) 23:33 Lajla: But (make-list 2 100) (if I recall correctly) generates a list of 100 2's. 23:33 Goodnewseveryone: She 23:33 Goodnewseveryone: actually 23:33 offby1: probably does. 23:33 Misterpond: we have to have (random 2) 23:33 Misterpond: somewhere... 23:33 offby1: rudybot: eval (make-list 2 5) 23:33 Lajla: Misterpond, you have. 23:33 rudybot: *offby1: ; Value: (5 5) 23:33 (join) adasdsadas 23:33 offby1: close enough 23:33 offby1: rudybot: eval (map random (make-list 5 2)) 23:33 rudybot: *offby1: ; Value: (0 1 0 1 1) 23:33 Lajla: What map does is it takes a list and a function, and outputs a new list which is the function applied to all elements from the old list. 23:33 offby1: actually that is rather elegant. 23:33 offby1: It doesn't have an "ignored" thing like mine does. 23:34 Lajla: Like (map square (list 1 2 3)) >> (1 4 9) 23:34 Lajla: So you first generate a list of 100 2 integers. 23:34 Lajla: And then you map random over it. 23:34 Lajla: Also, offby1's version is also nice. 23:35 Misterpond: lol...um...I don't think you're suppose to generate 100 numbers 23:35 Misterpond: what's offby1's version? 23:35 offby1: rudybot: eval (build-list 50 (lambda (ignored) (random 2))) 23:35 rudybot: *offby1: ; Value: (0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 0 0 1 1 0 1 0 0 0 1 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 1 0 1 1 1 1 1) 23:35 Lajla: rudybot: eval (map random (build-list 10 2)) 23:35 rudybot: Lajla: error: build-list: expected argument of type ; given 2 23:35 offby1: essentially the same 23:35 Lajla: Ahhh 23:35 Lajla: rudybot: eval (make-list 10 2) 23:35 rudybot: Lajla: ; Value: (2 2 2 2 2 2 2 2 2 2) 23:35 Lajla: Good 23:35 offby1: "make-list" and "build-list" are subtly different 23:36 Lajla: Yeah 23:36 Lajla: rudybot: eval (map random (make-list 10 2)) 23:36 rudybot: Lajla: ; Value: (0 0 0 1 0 1 0 1 1 1) 23:36 Lajla: rudybot: (map square (list 1 2 3 4)) 23:36 rudybot: Lajla: I've got a vector of N^2 length. How can I print a 'square' of N values per line? I know it's trivial, but I haven't done scheme in awhile. 23:36 Misterpond: I wish I could say I understand that. But you'll REALLY have to dumb it down for me 23:37 Lajla: rudybot: eval (map square (list 1 2 3 4)) 23:37 rudybot: Lajla: error: reference to undefined identifier: square 23:37 offby1: rudybot: we're asking the questions around here. 23:37 rudybot: *offby1: I asked questions about this before - with the latest release/emacs 2.3 I have extreme (nondeterministic) delays starting Emacs. They only occur with the latest version, and only with the network connected. 23:37 Goodnewseveryone: oh don't worry, he will 23:37 Lajla: Ahh 23:37 Lajla: Weird 23:37 Goodnewseveryone: offby1, being his usual delightfully condescending self, thinks you're a moron. 23:37 Goodnewseveryone: he will gladly dumb it down for you 23:37 offby1: that bot has some psychological issues. 23:37 Goodnewseveryone: GOOD NEWS EVERYONE! 23:37 offby1: a fine worker, though 23:37 Lajla: rudybot: eval (map sqrt (list 1 2 4 9)) 23:37 rudybot: Lajla: ; Value: (1 1.4142135623730951 2 3) 23:37 offby1: Misterpond: so are you getting what we're doing? 23:37 Misterpond: NO. NOT AT ALL 23:37 offby1: oh. 23:37 Misterpond: what would the variable be? 23:37 offby1: what variable? 23:38 offby1: why does there gotta be a variable? 23:38 Lajla: Misterpond, look closely at the result of this: 23:38 Misterpond: of the dunction 23:38 offby1: why does there gotta be a variable? 23:38 offby1: is that part of the assignment? 23:38 offby1: to use a variable? 23:38 Lajla: rudybot: eval (map sqrt (list 1 4 9 16 25)) 23:38 rudybot: Lajla: ; Value: (1 2 3 4 5) 23:38 Misterpond: I don't know...I just assumed there are generally variables in functions 23:38 Lajla: You see the pattern right? 23:38 Misterpond: wait, if you were to explaint eh function in words 23:39 (part) ttuttle 23:39 offby1: Misterpond: forget about variables for a second, and pay attention to Lajla ... h 23:39 Lajla: Misterpond, have they already introduced you to the horror that in scheme it is considered bad practise to change the value of a variable. 23:39 Lajla: The first time somebody said that in that channel. 23:39 Lajla: rudybot eval (define (double x) (+ x x)) 23:39 Lajla: rudybot: eval (define (double x) (+ x x)) 23:40 Lajla: Better 23:40 Lajla: rudybot: eval: (map double (list 1 2 3 4)) 23:40 rudybot: Lajla: In my patch I'm trying to keep it exact, but there are issues with the fact that the translation goes through an inexact double, for instance:> 12e45 23:40 offby1: :) 23:40 Misterpond: the function has to be called toss-coin 23:40 offby1: nix the : after the eval 23:40 Misterpond: so (define (toss-coin 23:40 Lajla: rudybot: eval (map double (list 1 2 3 4)) 23:40 rudybot: Lajla: ; Value: (2 4 6 8) 23:40 Lajla: Good 23:40 offby1: rudybot: eval (map (lambda (x) (+ x x)) (list 1 2 3 4)) 23:40 rudybot: *offby1: ; Value: (2 4 6 8) 23:40 Lajla: finally 23:40 Lajla: offby1, not sure if misterpond knows lambda 23:40 offby1: hmp 23:40 Misterpond: no 23:40 Misterpond: I do not 23:41 offby1: oh. 23:41 Lajla: Misterpond, as a function of what, the number of tosses? 23:41 Misterpond: I guess so 23:41 Lajla: Misterpond, I'll spoil it and we work top down: (define (toss-coin n) (map random (make-list n 2))) 23:42 Lajla: Which incidentally happens to be syntactic sugar for (define toss-coin (lambda (n) (map random (make-list n 2)))) 23:42 offby1: Misterpond: have you learned about "map" and "make-list"? Do you supposed you'd be allowed to use those? 23:42 Misterpond: make-list is cons? 23:42 Misterpond: like construct? 23:42 offby1: only a little. 23:42 Misterpond: I have no idea what map is 23:43 offby1: well, what functions _are_ you allowed to use? 23:43 offby1: do you have a list of them? 23:43 Misterpond: (sub1 n) 23:43 Lajla: Misterpond, well, look at this pattern: 23:43 Misterpond: that's the hint 23:43 Misterpond: (sub1 n) 23:43 (quit) Goodnewseveryone: Quit: Page closed 23:43 offby1: map is so basic that (unless the point of the exercise is to write it yourself) it's hard to see how you can do it. 23:43 Lajla: rudybot: eval (map double (list 1 2 3 4 5)) 23:43 rudybot: Lajla: ; Value: (2 4 6 8 10) 23:44 Lajla: Of course double is just a function that doubls its argument, like (double 4) evaluates to 8 23:44 offby1: man, "sub1 n" sure doesn't sound like much of a hint. 23:44 Misterpond: like you're suppose to subtract 1 from 100 I think? 23:44 offby1: Misterpond: I don't suppose this assignment is online where we could look at it? I can't help but think we're missing some important piece of information 23:45 Lajla: Ahh 23:45 Misterpond: no. I'll type it out for you though 23:45 Misterpond: Using a computer, write a program with two functions that will find the number of heads generated by flipping a coin 100 times: 23:45 Misterpond: New ideas: (random 2) --> 0 or 1 23:46 Misterpond: (sub1 n) subtracts one from n 23:46 Misterpond: ;;function 1: toss-coin 23:46 Misterpond: ;;purpose: to gerneerate a list of random nums (0 or 1) given number of times to flip the coin 23:46 Misterpond: ;;contrat: toss-coin: num --> list of numbers 23:46 Misterpond: -end of transmission- 23:47 Lajla: http://codepad.org/dAVhSV16 23:47 Lajla: A bit longer than using map, but it essentially does the same if you get how map is defined 23:48 Lajla: Probably compiles to the same code 23:48 Lajla: If you use inlining 23:48 offby1: I wrote more or less the same thing myself, but mine uses constant space :-) 23:48 offby1: http://gist.github.com/612779 for an alternative, not necessarily better 23:49 offby1: actually mine doesn't even use constant space, now that I think about it. 23:49 Lajla: offby1, you taill caller 23:49 Lajla: offby1, it doesn't, cons eh 23:50 offby1: http://gist.github.com/612784 less stupider 23:50 (quit) alexsuraci: Remote host closed the connection 23:50 (join) confounds 23:50 offby1 hopes he doesn't use up all the gist-space 23:50 offby1: Misterpond: are we helping any? 23:50 Misterpond: yes plenty 23:50 offby1: yay us 23:50 Misterpond: this stuff is looking famillar 23:50 (join) alexsuraci 23:50 Misterpond: 80% famillar 23:51 (quit) alexsuraci: Excess Flood 23:51 Lajla: offby1: http://codepad.org/c7YSZ2Nl 23:51 (join) alexsuraci 23:51 Lajla: Mine is shorter