00:52 (quit) martinhex: Remote host closed the connection 00:55 (join) martinhex 00:57 (join) rbarraud 01:30 (quit) rbarraud: Ping timeout: 276 seconds 01:45 (join) vu3rdd 02:00 (join) rbarraud 02:10 (quit) jonrafkind: Ping timeout: 265 seconds 04:16 (join) masm 06:46 (quit) rbarraud: Remote host closed the connection 06:47 (join) rbarraud 07:00 (join) xrymbos 07:01 xrymbos: hi 07:01 xrymbos: is there a concise way to get a list of numbers from 1 to 100? 08:01 Lajla: xrymbos, sure is. 08:01 Lajla: range 08:01 Lajla: rudybot: eval (range 1 101) 08:01 rudybot: Lajla: error: reference to undefined identifier: range 08:01 Lajla: I think 08:01 Lajla: Ahh, npt 08:01 Lajla: What is range called here man? 08:01 Lajla: It's always caleld range 08:01 Lajla: Oh well, then this 08:02 Lajla: rudybot: eval (list-build 100 (lambda (n) (+ 1 n)) 08:02 rudybot: Lajla: error: eval:1:0: read: expected a `)' to close `(' 08:02 Lajla: fff 08:02 Lajla: rudybot: eval (list-build 100 (lambda (n) (+ 1 n))) 08:02 rudybot: Lajla: error: reference to undefined identifier: list-build 08:02 Lajla: Ffff 08:02 Lajla: rudybot: eval (build-list 100 (lambda (n) (+ 1 n)) 08:02 rudybot: Lajla: error: eval:1:0: read: expected a `)' to close `(' 08:02 Lajla: ffffffffffffffff 08:02 Lajla: rudybot: eval (build-list 100 (lambda (n) (+ 1 n))) 08:02 rudybot: Lajla: ; Value: (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100) 08:02 Lajla: Yeah 08:02 xrymbos: awesome 08:03 xrymbos: thanks :) 08:03 Lajla: xrymbos, I am actually better with this than this example might let you think 08:03 Lajla: xrymbos, anyeay 08:03 Lajla: way* 08:03 Lajla: What you can now do is (define (range start finish) (build-list finish (lambda (n) (+ n start)))) I guess 08:03 Lajla: It's not as good as the range that I have running here though 08:04 Lajla: Which also goes backawrds and can step 08:04 xrymbos: yup, cool 08:12 Lajla: xrymbos: http://pastebin.com/p3YT654s 08:12 Lajla: Haven't tested it though 08:12 xrymbos: oh man, you can do x.xs? 08:12 Lajla: Also, some would argue that my code is not idiomatic, but that is just how I roll. 08:12 xrymbos: awesome :) 08:13 Lajla: Well, it's not a pattern matching like in haskell 08:13 (join) hanDerPeder 08:13 Lajla: http://pastebin.com/bGcmk7bC this is indented slightly better 08:14 Lajla: NO 08:14 Lajla: It doesn't work with negative ranges. 08:14 Lajla: I failed 08:15 Lajla: Ahh 08:15 Lajla: I see the bug. 08:16 Lajla: Well actually let it be like that 08:16 Lajla: That's actually good 08:17 Lajla: if you want negative, use (range 10 4 -1) 08:18 Lajla: xrymbos, http://pastebin.com/mpfk8gC9 08:18 (quit) rbarraud: Read error: Connection reset by peer 08:18 Lajla: I stand by that version 08:44 (quit) xrymbos: Ping timeout: 276 seconds 08:58 (join) b-man_ 09:30 Lajla: http://www.ccs.neu.edu/scheme/pubs/scheme2009-fb.pdf eli, why do you write PDF documents I randomly google? 09:30 Lajla: Stalker 09:43 (join) TOSTO 10:18 (join) MayDaniel 10:34 (join) confounds 10:38 (quit) samth_away: Quit: Ex-Chat 10:47 (quit) hanDerPeder: Quit: hanDerPeder 10:49 (join) hanDerPeder 10:49 eli shrugs 11:22 (quit) hanDerPeder: Quit: hanDerPeder 11:35 (quit) vu3rdd: Remote host closed the connection 11:42 (join) carleastlund 11:45 (join) danbrown 11:52 (join) sstrickl 11:52 (quit) b-man_: Remote host closed the connection 12:16 (join) jonrafkind 12:22 (quit) danbrown: Quit: danbrown 12:37 (join) tommc 12:41 (join) hanDerPeder 12:48 (quit) hanDerPeder: Ping timeout: 276 seconds 12:51 (quit) MayDaniel: 12:52 (quit) confounds: Remote host closed the connection 13:09 (join) confounds 13:14 (join) hanDerPeder 13:16 (join) b-man_ 13:18 jonrafkind: unstable/find is whacky.. it alternatively tests the cdr of the list and the car of the list 13:41 (quit) bremner: Quit: ZNC - http://znc.sourceforge.net 13:45 (join) bremner 13:47 (quit) bremner: Client Quit 13:48 (join) bremner 13:49 (join) danbrown 13:50 (quit) bremner: Client Quit 13:50 (join) bremner 13:53 (quit) bremner: Client Quit 13:55 (quit) tommc: Ping timeout: 265 seconds 13:57 (join) bremner 14:06 (quit) confounds: Remote host closed the connection 14:34 (join) mceier 14:37 carleastlund: jonrafkind, why is that behavior wacky? 14:38 jonrafkind: i expected it to just look at each element of the list and run the predicate on it 14:38 jonrafkind: i eventually wrote my own function to do that 14:39 jonrafkind: because my predicate expects a certain type (the type of the element), when it receives a list of elements it barfs 14:40 carleastlund: What list? 14:40 carleastlund: The input to "find" from unstable/find does not have a list anywhere in it. 14:41 jonrafkind: find symbol? '((all work) and (no play))) 14:41 jonrafkind: im pretty sure the second argument is a list 14:41 jonrafkind: http://docs.racket-lang.org/unstable/find.html?q=unstable/find 14:41 carleastlund: Sure, and I can pass a list to print as well, but when describing what print does I don't say "the list". 14:41 jonrafkind: unless these docs have changed a whole lot 14:42 carleastlund: Which input to find is "the list"? 14:42 jonrafkind: the second argument 14:42 carleastlund: x : any/c 14:42 carleastlund: Doesn't look like a list to me. 14:48 (join) ttuttle 14:48 ttuttle: What exactly happens if I mutate the elements in a set? (I'm writing a chat client, and trying to keep track of the people in a channel, when their nicknames might change. 14:49 jay-mccarthy: unexpected things 14:51 ttuttle: alright, I guess I'll just use a list. 14:51 jay-mccarthy: you can have a set that you keep in a box 14:52 jay-mccarthy: you just can't mutate the ELEMENTS of the set 14:52 ttuttle: oh, right 14:52 ttuttle: well 14:52 jay-mccarthy: (define s "Jay") 14:52 jay-mccarthy: (define ss (set s)) 14:52 jay-mccarthy: (set-member? ss "Jay") => #t 14:52 ttuttle: I need to be able to mutate the items, since people's names can change. 14:52 ttuttle: So I guess I just can't use a set. 14:52 jay-mccarthy: (string-set! s 2 #\e) 14:52 jay-mccarthy: (set-member? ss "Jae") => unknown 14:53 jay-mccarthy: you could remove the old name and add the new name 14:54 (join) samth 14:54 ttuttle: ...hmm. 14:55 carleastlund: If you use an eq-based set, you're safe. Mutation won't affect eq? or eq-hash-code. 14:55 ttuttle: so, as long as a user remains online, their box should never change, only the contents of the box 14:55 carleastlund: Or if you make a custom structure with a prop:equal+hash-code that is oblivious to its mutable fields, that'll work too. 14:56 ttuttle: I mean, the only reasonable identifier for an IRC user is their nickname. 14:56 ttuttle: and that can change. 14:56 carleastlund: In that case, it's not a very useful key for a set. 14:56 ttuttle: I mean, at any given point, it is. 14:56 carleastlund: If the only reasonable identifier is something that changes, it sounds like you don't have an identifier. Or, you need to treat "changes" as removing one user and adding another. 14:56 ttuttle: But over time it's not. 14:57 ttuttle: I guess changes will need to be remove and readd. 14:57 carleastlund: Well, if your sets need to persist over time, they need element identity that does, too. 15:13 ttuttle: man, this is going to be full of O(n^2) operations >.< 15:13 ttuttle: or at least O(n_channels) 15:30 ttuttle: Man, I am remembering why I loved functional programming so much. 15:33 (join) MayDaniel 15:33 Lajla: ttuttle, as far as the client goes, it only needs to keep track of which nickname says what, and when a nickname changes I guess. 15:33 Lajla: Like, let's say I do /nick foo when you are not in this channel. 15:33 Lajla: Like you quit, I do /nick foo,and you come back. 15:34 ttuttle: Lajla: Oh, I know I can't track that. 15:34 Lajla: THere is no way for you to know then if I changed, or if I left and another joined. 15:34 Lajla: So you can't track of 'who is in the channel' 15:34 ttuttle: Lajla: I'm only tracking this for channels I'm in. 15:35 Lajla: I guess then you could just give them all a number. 15:38 (quit) MayDaniel: 16:06 (quit) lisppaste: Ping timeout: 240 seconds 16:08 (quit) b-man_: *.net *.split 16:23 (quit) sstrickl: Quit: sstrickl 16:28 ttuttle: Is there any way to erase all the mappings in a (mutable) hash at once? 16:29 jay-mccarthy: why not just start using a new one 16:31 carleastlund: Alternately, use immutable hash tables. Then using a new one is just as simple, and much more natural. :) 16:33 (join) xrymbos 17:13 Lajla: ttuttle, is there any reason by the way why constructing a new set with the old set as a base won't work? 17:22 (join) confounds 17:25 ttuttle: Lajla: that will work, but I've decided to use a hash and just remove and readd instead 17:25 Lajla: ttuttle, the inevitable quaestion arising: why scheme if you want to use destructive update? 17:25 ttuttle: Lajla: IRC is annoyingly stateful 17:26 ttuttle: Lajla: I am containing all the stateful stuff in one ugly class. 17:28 samth: Lajla, b/c Racket is a great language for writing imperative programs in 17:28 ttuttle: mutable hashes are lovely to work with 17:28 ttuttle: and this state is inherently mutable, so I see no reason to pretend it's not and then stick it in a box. 17:30 Lajla: samth, you are a very strange person. 17:31 ttuttle: samth is right though :P 17:38 samth: how is that strange? 17:38 samth: I would say the strange person is the one on #racket wondering why people are using Racket 17:39 ttuttle: I am using it because, even though my program has to have some imperative parts, it is a joy to implement the rest functionally, and Racket has things like events that free me from doing stupid gruntwork. 17:47 ttuttle: I have to admit it is confusing getting used to explicit currying. (The last functional language I used was SML, for class.) 17:53 carleastlund: Racket is a functional, imperative, object-oriented, dynamic, typed, reactive language. You can combine any or all of those features in one program, along with anything else you find in our libraries. We don't believe in "our way or the highway". We throw in everything, including the highway and the kitchen sink. 17:54 jonrafkind: you should put that on the racket-lang.org 17:54 ttuttle: it is awesome 17:54 carleastlund: And, ttutle: while mutation and mutable hashes are just fine, very little is "inherently mutable", depending on your programming model. 17:56 carleastlund: IRC identities inherently *change over time*, that is true. Mutation is only one way of modeling change over time. 17:56 ttuttle: somewhat sadly, my event model is imperative. 17:56 ttuttle: (modules call an event-callback to propagate events.) 17:57 jonrafkind: isnt CML (store-passing style) a way to handle changes over time? 17:57 ttuttle: I would have used handle-evt, but that'd require that every low-level event (e.g., line read from the IRC server) mapped to one high-level event. 17:57 carleastlund: CML is not in any way related to store-passing style, as far as I know. 17:58 carleastlund: ttuttle: (a) that's probably not true, and (b) I don't see it as a problem anyway. 17:58 jonrafkind: oh maybe i confused terms, but the point is about store-passing style, not CML 17:58 ttuttle: carleastlund: okay, cool. 17:58 ttuttle: I don't see a particular problem with propagating events imperatively, as long as the flow is clear. 17:59 carleastlund: In any event, there is an advantage to sticking an immutable hash table in a box -- you get mutation at the top level, which can simplify your event model, but back-end libraries get to work with the data in a persistent manner, and "emptying" the hash table becomes really easy. 17:59 carleastlund: I'm a big fan of putting a thin layer of mutation at the top level of a program, and then programming purely functionally from there down to the bottom. It's often a really convenient way to work -- you can interface with imperative APIs, but you can test your programs functionally and so forth. 18:01 ttuttle: hmm 18:02 ttuttle: so the interface between the "irc client" class and the "keep track of who's where" class is imperative, and I don't think I want to change that. 18:02 ttuttle: but I might be able to make the guts of the tracker class more functional. 18:03 (quit) jonrafkind: Ping timeout: 260 seconds 18:03 carleastlund: On the other hand, (define (reset-hash! h) (for ([k (in-hash-keys h)]) (hash-remove! h k))) is really easy to write. ;) 18:11 (join) rmitt 18:22 (join) neilv 18:22 (quit) neilv: Changing host 18:22 (join) neilv 18:29 (join) Nanakhiel 18:33 (quit) Lajla: Ping timeout: 276 seconds 18:35 (quit) carleastlund: Quit: carleastlund 18:47 (join) rbarraud 19:01 (quit) danbrown: Quit: danbrown 19:17 (quit) rmitt: Quit: Page closed 19:27 (quit) mceier: Quit: leaving 19:52 (join) kingless 20:01 (quit) kingless: Quit: Colloquy for iPad - http://colloquy.mobi 20:32 (join) Fare 20:38 (quit) hanDerPeder: Quit: hanDerPeder 21:07 (quit) Fare: Quit: Leaving 21:13 (quit) confounds: Remote host closed the connection 21:16 (quit) xrymbos: Remote host closed the connection 21:17 (quit) neilv: Quit: Leaving 21:38 (join) masm1 21:39 (quit) masm: Ping timeout: 250 seconds 22:24 (quit) masm1: Quit: Leaving. 23:26 (join) neilv 23:26 (quit) neilv: Changing host 23:26 (join) neilv 23:38 (quit) rudybot: Remote host closed the connection 23:38 (join) rudybot