00:02 (join) jrslepak 00:03 (join) jao 00:05 (join) rudybot 00:19 (quit) jrslepak: Quit: What happened to Systems A through E? 00:23 (join) yoklov 00:38 (join) Demosthenes 00:54 (join) gciolli 00:58 (quit) Shvillr: Ping timeout: 246 seconds 00:58 (join) Shvillr 01:03 (quit) yoklov: Quit: computer sleeping 01:13 (quit) jonrafkind: Ping timeout: 260 seconds 01:16 (join) cdidd 01:20 (join) realitygrill 01:53 (quit) dous: Remote host closed the connection 02:12 (quit) jeapostrophe: Remote host closed the connection 02:13 (join) jeapostrophe 02:22 (quit) jeapostrophe: Read error: Operation timed out 02:36 (join) vkz 02:43 (quit) vkz: Quit: vkz 02:44 (join) vkz 03:16 (join) dous 03:21 (quit) gciolli: Quit: Leaving. 03:22 (quit) realitygrill: Ping timeout: 246 seconds 03:22 (quit) vkz: Ping timeout: 246 seconds 03:23 (join) realitygrill 03:26 (join) vkz 03:35 (join) RacketCommitBot 03:35 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/AxBIdw 03:35 RacketCommitBot: [racket/master] New Racket version 5.2.900.2. - Eli Barzilay 03:35 (part) RacketCommitBot 03:50 (join) fftb 03:50 (part) fftb 03:54 (join) Cryovat 04:09 (quit) realitygrill: Quit: realitygrill 04:21 (quit) vkz: Quit: vkz 04:35 (join) gciolli 04:35 (join) MayDaniel 04:41 (quit) Cryovat: Ping timeout: 245 seconds 05:07 (join) Cryovat 05:25 (quit) Cryovat: Ping timeout: 265 seconds 05:58 (quit) djcb: Remote host closed the connection 06:03 (join) yoklov 06:08 (quit) yoklov: Ping timeout: 276 seconds 06:14 (quit) MayDaniel: Read error: Connection reset by peer 06:18 (quit) karswell: Ping timeout: 245 seconds 06:25 (join) MayDaniel 06:27 (join) fftb_ 06:30 (quit) gciolli: Ping timeout: 260 seconds 06:34 (quit) mithos28: Quit: mithos28 06:44 (quit) jao: Ping timeout: 252 seconds 06:57 (quit) fftb_: Remote host closed the connection 06:57 (join) mceier 07:31 (join) gciolli 07:31 (join) vkz 07:43 (quit) vkz: Read error: Connection reset by peer 07:44 (join) vkz 07:46 (join) Cryovat 07:51 (join) MayDaniel_ 07:54 (quit) MayDaniel: Ping timeout: 246 seconds 08:03 (join) masm 08:17 (quit) masm: Ping timeout: 246 seconds 08:17 (quit) gciolli: Ping timeout: 245 seconds 08:19 (join) samth_ 08:30 (join) bdirks 08:40 (join) masm 08:40 (quit) bdirks: Quit: Colloquy for iPad - http://colloquy.mobi 09:07 (quit) dous: Remote host closed the connection 09:26 (quit) mceier: Quit: leaving 09:27 em: is there a way, or does it not matter, when making a hash-table to set the order of the keys? 09:28 em: at first glance, hash-tables seem very nice. Is it bad 'racket form' to use hash tables instead of lists? 09:43 em: I notice that a hash does not remember its own name. 09:44 em: as in, if you create a hash called hash1 and then (display hash1) it doesn't say anywhere that it is hash1. 09:44 (quit) MayDaniel_: Read error: Connection reset by peer 09:44 em: So I wonder how will I store this hash outside the program. 09:46 em: I guess what I can do is create a list that has all the names of each hash, then I can map over that list with (make-hash ) 09:46 rapacity: you can store it like this (display-to-file #hash((1 . 2)) "hashfile.txt") 09:47 rapacity: then read it back using (read (open-input-file "hashfile.txt")) 09:48 em: oh display-to-file i didn't know about that. That is probably convenient 09:50 rapacity: or err write-to-file is probably better for this 09:51 em: do you have to open some sort of file first? 09:51 em: before you write to it? 09:51 em: where does it place "hashfile.txt" ? 09:52 rapacity: current working directory on racket, I'm not sure where drracket would place it though 09:53 em: it put it into my home directory. 09:54 em: rapacity: so should a person just have a different .txt for each hash or a flat file of all the hashes they need in their program? 09:54 (join) mceier 09:59 rapacity: if you want to do a change on a single hashtable and use the above functions and you're only using one file, you'd have to read all the hashtables and write them all back to do the change 10:00 rapacity: if you're working with alot of data you ought to use a database 10:06 (join) gciolli 10:10 (quit) gciolli: Ping timeout: 245 seconds 10:11 em: rapacity: is there a way to force write-to-file to overwrite? 10:12 rapacity: yeah #:exists 'replace 10:14 em: rapacity: oh that's very nice! 10:15 em: rapacity: these are the most important things to know I think in order to use racket to make a program. I wish someone would teach this stuff! 10:15 em: How did you find out about them? 10:16 rapacity: I read he docs :p 10:16 rapacity: the* 10:16 em: so far all I ever do is make scheme programs that do stuff like find prime numbers. So it never 'interacts' with the world outside of it. I want to make a program that does something. 10:17 chandler: Well, you've come to the right place then. 10:17 (join) gciolli 10:26 asumu: em: I suggest reading the guide, which has a chapter on I/O for example. 10:31 (join) MayDaniel 10:41 (join) jeapostrophe 10:42 (quit) gciolli: Ping timeout: 260 seconds 10:50 (join) karswell 10:54 (join) anRch 10:56 (quit) MayDaniel: 11:00 (join) gciolli 11:04 (quit) Cryovat: Ping timeout: 246 seconds 11:09 (join) djcb 11:15 (join) neilv 11:16 (join) yoklov 11:17 neilv: submodules in a release is weeks or months away, correct? 11:30 (join) MayDaniel 11:34 (quit) gciolli: Ping timeout: 244 seconds 11:38 em: rapacity: when I use (read (open-input-file "myhash.txt")) it does not return something that is immediately useable by the program. For example I cannot do: (hash-set! (read (open-input-file "myhash.txt")) "key" 2) 11:39 em: it returns something that looks like #hash(("key" . value)) 11:39 (quit) samth_: Ping timeout: 246 seconds 11:40 jeapostrophe: neilv: yes 11:41 (quit) anRch: Quit: anRch 11:44 neilv: i have code split across 6 files, mostly for phase reasons, and refactoring it seems much harder than it would be if in 2 files. i eagerly await submodules 11:46 em: i think that make-hash makes a mutable hash and #hash() is an immutable hash. 11:47 (join) anRch 11:48 neilv: #hash is a reader thing, for literals in the code, and you generally want those to be immutable 11:48 rapacity: hmm 11:48 neilv: but you can use immutable hashes functionally, including adding and removing elements 11:49 rapacity: is there a built-in function to return a mutable hash given an immutable hash? 11:51 rapacity: if you want to get a mutable hash you can do (make-hash (hash->list immutable-hash)) 11:51 neilv: hash-copy 11:52 rapacity: ah 11:52 neilv: but everyone should learn to use immutable hashes functionally 11:53 neilv: and they should not use any of the "for"-something forms until they have mastered named-"let" :) 12:02 em: rapacity: well #hash(..) itself seems to be immutable. 12:02 neilv: http://docs.racket-lang.org/reference/reader.html?q=%23hash#%28idx._%28gentag._67._%28lib._scribblings/reference/reference..scrbl%29%29%29 12:02 rudybot: http://tinyurl.com/7h22nsr 12:04 mattmight: How do I figure out the equivalent of $0 in Racket -- the name used to execute a script/program? 12:06 jeapostrophe: mattmight: find-system-path with 'run-file, i believe 12:07 mattmight: thanks :) 12:07 jeapostrophe: mattmight: also, you can look at (current-command-line-arguments)[0] 12:07 mattmight: The latter doesn't seem to work. 12:07 mattmight: It yields #() for a run with no arguments. 12:08 jeapostrophe: ya, it says "except for ones parsed by the system", so maybe that includes the file you required 12:08 jeapostrophe: but the find-system-path should be useful 12:08 mattmight: yeah, that seems to work 12:10 rapacity: em: you can do (write-to-file (hash-set (read (open-input-file "myhash.txt")) "key" 2) "myhash.txt" #:exists 'replace) to update the file 12:10 rapacity: or use the hash-copy function neilv mentioned to get a mutable hash from the immutable one 12:11 jeapostrophe: rapacity & em: write-to-file and file->value are very convenient 12:14 rapacity: didn't realize that there was a file->value :p thanks 12:16 em: ive been using hash-set! not hash-set 12:18 (quit) neilv: Quit: Leaving 12:19 (join) crunchybumble 12:21 (join) synergizm 12:24 em: jeapostrophe: so say for each of the hashes I want to use in my program, i have a .txt file for each one. How do I 'load' each of those files (assume they are in a common directory) so that they are in the programs memory and I can start doing stuff with them. (also once the program is done, how should it 'save all the changes to all the hashes' ) ? 12:25 em: seems like i need to give a name to each of the hashes as they are read from the file. 12:25 em: but i also have to refer to the name of the file itself. 12:34 offby1: em: I would have _another_ has whose keys are names, and whose values are the hashes that correspond to the names. 12:35 offby1: you can deduce the filename from the name, and load it with "read", and save it with "write". 12:35 offby1: I think. 12:36 offby1: rudybot: (write (make-hash '((1 . one) (2 . two)))) 12:36 rudybot: offby1: your sandbox is ready 12:36 rudybot: offby1: ; stdout: "#hash((1 . one) (2 . two))" 12:36 offby1: looks OK 12:37 crunchybumble: from the documentation, how is one supposed to know whether a given method is overrideable, merely augmentable, or final? Is one expected to go back to the source whenever subclassing? 12:37 offby1: heh, no idea 12:38 offby1: I basically never uses classes 12:38 crunchybumble: It seems like the GUI framework is premised on an OO model? 12:38 offby1: seems like it. 12:38 offby1: as far as I know that's the only bit of racket that is. 12:39 em: offby1: it's kind of the same problem then. because the thing is you at some point want to have a hash called like hash1 that you can 'do stuff with'. 12:40 em: there is a hash1.txt file and there is a hash called hash1 that you can work on. 12:40 offby1: well, your problem, I think, is that you want to have _variable_ names match the file name 12:40 offby1: but variable names _don't exist_ at runtime (unless you play tricks with namespaces) so it's hard 12:40 em: at the start of the program i need to define hash1 as the hash using hash1.txt data and at the end of the program I need to save whatever the current state of hash1 is to hash1.txt 12:40 em: does it make sense? 12:41 offby1: yes, although when you say "define hash1" I would think (hash-set master-hash-table "hash1" (with-input-from-file "hash1" read)) 12:41 offby1: and I bet you're thinking (define hash1 ....) 12:41 em: yes i was. 12:42 em: i thought i would have to (map define ... ) or something like that. 12:42 em: over a list of all the names 12:42 em: offby1: but you see now where is the program getting 'hash1' from? 12:42 em: the word 'hash1' 12:42 offby1: sure 12:43 offby1: it's easy if you forget about using a variable named hash1 12:43 offby1: (it's actually doable that way; I just don't know how to do it and it's not portable) 12:43 offby1: ((and I don't think there's much benefit anyway)) 12:43 synergizm: hey guys im new to racket and linux aswell. i installed drracket using the muon package manager on kubuntu. it lets me start the gui but its slow as hell. anyone got an idea why? 12:43 em: in my program some where i need to be able to update the right hash, and it seems like to do that i need to give it a name somewhere. 12:43 (join) GeneralMaximus 12:43 jeapostrophe: synergizm: what is slow? what does top say? 12:44 jeapostrophe: em: you should put your hashes inside a struct like (struct emhash (filename the-hash)) 12:45 jeapostrophe: crunchybumble: the GUI is premised on OO and basically everything is overrideable. something that is the other kinds will be mentioned, but overrideable is the default 12:45 synergizm: jeapostrophe : if i open a rkt file it takes few secs to load and to highlight the colors. after that i can scroll around but it freezes all the time. what u mean by top? 12:45 offby1: em: I ain't gonna argue scripture with no nun™, but I'd just have a hash-of-hashes. 12:46 jeapostrophe: synergizm: 'top' is a unix command that tells you system / memory / etc usage 12:46 jeapostrophe: em: either is fine 12:46 crunchybumble: I'd like to highlight the innermost sexp I'm hovering-over in a text% editor. I'm subclassing text:basic%, and considering having to build my own sexp-snip%. Would subclassing the racket:sexp-snip% be easier/cleaner/better? 12:47 jeapostrophe: crunchybumble: no idea, i've never been near that stuff 12:47 em: synergizm: i suggest uninstalling that and using the PPA on launchpad. That way you get the most recent version also. I also have Kubuntu and that's how I do it. https://launchpad.net/~plt/+archive/racket 12:48 em: jeapostrophe: either what is fine? 12:48 (join) antithesis 12:49 em: offby1: I get the idea of having a hash of hashes. That way I could refer to any hash I like by using the key in the hash of hashes right? The trick is, how do I 'create' the hash of hashes at start up? 12:49 synergizm: jeapostrophe : top tells me that xorg is using about 80% cpu while having drracket started 12:49 rapacity: get the list of files in the directory with the hash text files 12:50 synergizm: @em gonna try that next but gonna have to read the howto first :) 12:51 em: rapacity: oh well that would help. 12:51 rapacity: you can use directory-list for that, example (diretory-list "hashfilefolder/") 12:51 (quit) jeapostrophe: Ping timeout: 260 seconds 12:51 offby1: em: creating a hash is easy -- (make-hash) makes an empty one, (make-hash ' ((1 . one))) makes one with one entry. etc 12:51 offby1: what rapacity said too 12:52 offby1: this probably won't work because of sandbox restrictions but let's see ... 12:52 offby1: rudybot: (diretory-list ".") 12:52 rudybot: offby1: error: reference to an identifier before its definition: diretory-list in module: 'program 12:52 offby1 scratches head 12:52 offby1: rudybot: (list-diretory ".") 12:52 rudybot: offby1: error: reference to an identifier before its definition: list-diretory in module: 'program 12:52 offby1: rudybot: (list-directory ".") 12:52 rudybot: offby1: error: reference to an identifier before its definition: list-directory in module: 'program 12:52 synergizm: jeapostrophe : yeah there must be some kind of problem with xorg whenever i minimize drracket it decreases the cpu usage. maximize again and its back at high % 12:52 offby1: rudybot: (directory-list ".") 12:52 rudybot: offby1: error: directory-list: `read' access denied for . 12:52 offby1: this time for sure 12:52 offby1: :) 12:53 crunchybumble: rudybot: ((lambda (x) x) 5) 12:53 rudybot: crunchybumble: your sandbox is ready 12:53 rudybot: crunchybumble: ; Value: 5 12:53 crunchybumble: rudybot: ((lambda (x) (x x)) (lambda (x) (x x))) 12:53 rudybot: crunchybumble: error: with-limit: out of time 12:54 offby1: em: here's how to get a hash with one (empty) hash for each file in the current directory: (map (lambda (p) (cons (path->string p) (make-hash))) (directory-list ".")) 12:54 offby1: crunchybumble: been there, done that 12:54 crunchybumble: rudybot: ((call/cc call/cc) (call/cc call/cc)) 12:54 offby1: ditto 12:54 rudybot: crunchybumble: error: with-limit: out of time 12:54 em: so im thinking I will make a 'master hash' that looks like this: #hash(( "hash1" . "hash1.txt") ("hash2" . "hash2.txt") ... ) 12:54 em: yeah? 12:55 offby1: it maps strings to strings? 12:55 offby1: if the second string names a file, that'd work 12:55 em: the second string names a file. I thought that the key had to be a string 12:55 offby1: the key can be pretty much anything 12:56 offby1: other languages like perl restrict keys to strings, but not racket. Nuh uh. 12:56 em: in the program i want to be able to do stuff like (add-data hash1) 12:56 offby1: hash tables are my favorite data structure 12:56 offby1: sure sure 12:56 synergizm: i installed drracket using the packagemanager on kubuntu. it lets me start the gui but whenever its maximized it makes Xorg's cpu usage go like crazy. any suggestions? 12:56 em: so the program has to know that hash1 is a hash. 12:56 offby1: it will 12:56 em: but i dont wnat it to all go away when the computer turns off. 12:56 offby1: yeah, you gotta write your data to files. 12:57 bremner: synergizm: what version of racket is that? 12:57 offby1: you might consider writing all your data to one big file instead of a bunch of little ones. 12:57 (join) gciolli 12:57 offby1: just last weekend I changed the way rudybot saves data to files; he used to use "read" and "write" (which is what you should start out with) but now uses a sqlite db 12:58 offby1: read and write are dead-simple, but for large amounts of data, pretty slow 12:58 offby1: plus reading a ton of data into memory ... uses a lot of memory :) 12:58 em: this will not be so much data 12:58 synergizm: bremner 5.1.1 12:58 offby1: yeah, read and write will probably be fine 12:58 em: you are right though maybe it should be just one big-ass hash that has all the data from all the hashes. 12:58 em: like hashes of hashes and just save one hash at the end and load one hash at the start. 12:59 em: it seems kind of weird some how though. 12:59 offby1: that's up to you; whatever seems most convenient 12:59 em: is this an inelegant or foolish thing ^ 13:00 offby1: just build something and see how it works! 13:00 em: well im not sure ive been able to verbalise why this 'how to start' problem is tricky to me, in the other way. 13:00 offby1: write one line of code that writes a scheme value to a file. 13:00 offby1: write another that reads it back. 13:01 offby1: If you've never done those things before, then doing them for the first time will give you a rush of power! 13:01 offby1: unfortunately the novelty soon wears off ... eventually you become jaded ... 13:01 em: see in the other way you have a different file for each hash. I want to do 'the same sort of things' to each of these hashes. So in use, my program should be able to do stuff like, (add-points hash3) and "points" whatever those are, are added to the right place of hash3. 13:01 offby1: sure sure 13:01 offby1: this is all very easy. 13:02 offby1: rather than agonizing over it, just whip something up and see if it works If not show us and we'll advise. 13:02 em: okay thanks very much I will do just that. 13:02 em: You are a great guy. 13:02 em: Also thanks to everyone who I've spoken with this morning, especially rapacity and jeapostrophe though he's gone. 13:04 offby1: I too may be gone, overpaying to have a car stereo installed. 13:04 (join) RacketCommitBot 13:04 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/iYkodw 13:04 RacketCommitBot: [racket/master] coerce picts to PS/PDF in 'smoothed mode - Matthew Flatt 13:04 (part) RacketCommitBot 13:04 (quit) anRch: Quit: anRch 13:08 (join) Cryovat 13:14 synergizm: now i installed drracket using launchpad (assuming i just had to add the plt in order to install it from the packagemanager after) version is now 5.2.1. its running a little bit better but still the xorg process is going crazy while using drracket. 13:18 (join) dzhus 13:21 bremner: synergizm: I don't really see anything like that on debian with 5.2.1 (running xmonad). 13:22 bremner: synergizm: you mean when drracket is idle, or is it running? 13:23 synergizm: bremner: as long at it is minimized my mashine runs normal. when i maximaze drracket without doing anything it slows everything down 13:23 (quit) gciolli: Read error: Connection reset by peer 13:23 synergizm: *i 13:24 bremner: can you see in another window what %cpu DrRacket is using? 13:24 bremner: it sounds like it might be kubuntu specific 13:25 synergizm: drracket never reaches more then 15% while im doing nothing with it 13:25 (join) gciolli 13:27 synergizm: well xorg always climbs up to 100% when im scrolling through the definitions window :/ 13:27 synergizm: drracket cpu usage doesnt change 13:28 crunchybumble: If I want to override a method with multiple distinct signatures, how do I declare which one I want to override? 13:28 (join) mithos28 13:29 (quit) MayDaniel: Read error: Connection reset by peer 13:29 crunchybumble: eg. insert in text% 13:30 (join) jeapostrophe 13:35 synergizm: yeah jeapostrophe back again :D ...got drracket 5.2.1 now but still same problem: as soon as i scroll inside the definitions window my xorg uses 100% cpu 13:40 (quit) gciolli: Ping timeout: 260 seconds 13:41 bremner: ok, I can more or less confirm that scrolling does spike the CPU 13:43 synergizm: hm more or less... for me its like watching a slideshow ^^ 13:44 synergizm: also when im typing it takes some time for the letters to accure 13:45 em: synergizm: did you uninstall the drracket you had installed first? And then, after you added the PPA did you do an apt-get update before doing apt-get install drracket ? 13:45 Cryovat: Until they have fixed it, imagine Hollywood style dramatic music and typewriter sounds wile it happens ;) 13:46 synergizm: em: yes and yes 13:47 synergizm: i dont think theres something wrong with the installations since in essence it works just fine 13:47 synergizm: xorg just has some problems with it i guess :/ 13:48 em: bremner: mine spikes somewhat. cpu is at around 4 percent. When I scroll in drracket definitions window 'fast' it goes up to 12 percent or 17 percent. 13:48 em: depending on how much and how fast i scroll 13:49 synergizm: ohh cmon whyy me :/ 13:49 em: i dont know if that's normal or how it compares to other programs. I have Kubuntu also. But ive not noticed any problems. Im also not running anything special as far as effects or other things like that though. 13:49 synergizm: me neither havent changed a thing 13:49 synergizm: u got an ati or nvidia? 13:50 em: synergizm: what version of Kubuntu? 13:50 em: I have an ATI radeon 6870 HD 13:51 synergizm: em: 11.10 13:51 bremner: ah, I have intel onboard graphics. Maybe it just sucks at scrolling. 13:51 synergizm: i got an 8600gt 13:51 (join) dnolen 13:53 em: someone might have some ideas in #kubuntu (wouldn't count on it) 13:53 synergizm: so i guess the problem might be the nvidia driver :S 13:54 em: synergizm: i have kubuntu 11.04 14:10 (quit) antithesis: Remote host closed the connection 14:12 (join) asdfhjkl 14:17 (quit) GeneralMaximus: Quit: Leaving 14:24 (join) jao 14:32 (join) MayDaniel 14:35 em: how can I 'create' a hash that will have exactly the name I want it to have? 14:35 em: for example, Im trying to do something like this: (define (make-client name actnum age) (define name (make-hash) (hash-set name "name" name) 14:35 em: etc 14:35 (quit) MayDaniel: Client Quit 14:36 em: im trying to instantiate a hash 14:37 offby1: I think you're confused 14:37 offby1: what is this "name" of which you speak? 14:38 em: so lets say i have a client named john. 14:38 offby1: if a "client" is nothing more than a string and two numbers, then you want a struct, not a hash. 14:38 offby1: you'll then almost certainly want some other data structure that contains a bunch of these clients, perhaps indexed by their names -- _that_ structure would be a hash. 14:39 (quit) vkz: Quit: vkz 14:39 em: eventually i want a hash named john. where john = #hash( ("name" . "john" ) ("actnum" . 2345234523) ("age" . 35)) 14:39 em: so that i can do stuff like this (add-age john) 14:40 em: or (age+ john) or whatever else 14:40 offby1: rudybot: (define john (make-hash ' (("name" . "john") ("actnum" . 2345234523) ("age" . 35)))) 14:40 rudybot: offby1: Done. 14:40 offby1: rudybot: john 14:40 rudybot: offby1: ; Value: #hash(("age" . 35) ("name" . "john") ("actnum" . 2345234523)) 14:40 offby1: rudybot: (hash-ref john "age") 14:40 rudybot: offby1: ; Value: 35 14:41 em: yes of course that will create that hash. i know that. 14:41 offby1: then ... ? 14:41 em: but now how do i create a procedure for making hashes which takes the name 14:41 em: for example (make-client john 2345235 24) 14:41 em: (make-client wendy 2345235 35) 14:41 em: what comes out of there has to be the hash called wendy 14:41 em: you get me? 14:41 offby1: if you want that procedure to create a _variable_ named "john", that's difficut, and in my humble opinion, not worth doing. 14:42 offby1: difficult 14:42 em: oh that sucks. I don't know how else to think about it. 14:42 offby1: thats ok 14:42 offby1: time to learn another way! 14:42 em: hehe 14:42 offby1: even if you _could_ make one individual variable per each client 14:42 em: i guess I can just type in every single client in hard code... 14:42 offby1: that'd be a lot of variables, if you had a lot of clients. 14:42 offby1: you'd have to write a _different_ piece of code for each client 14:43 offby1: since each piece of code would have the variable's name right in it 14:43 offby1: and that would totally suck 14:44 offby1: I myself would have _one_ variable, named something like "name", which would at various times hold strings like "john", "mary", "ted" etc. 14:44 (quit) jeapostrophe: Ping timeout: 244 seconds 14:44 em: yeah but how can you make a procedure that lets you make many different hashes, one for each client, in a way that lets you 'find the right hash' latter on when you want to work with it. 14:44 offby1: perhaps I'd write a loop that goes over each client once; inside the loop, "name" is bound to that client's name. 14:44 offby1: to answer your question: you keep _another_ "master" hash, that maps names to client hashes. 14:44 offby1: as I said earlier. 14:44 em: so you are saying don't give the hashes names, but then loop over a list of all the hashes searching for their name? 14:45 offby1: hmm maybe 14:45 offby1: certainly don't make a separate variable for each hash 14:45 offby1: that's silly because when you write your program you cannot even know for sure the names of all your clients! 14:46 em: the reason i was trying to make a separate variable for each hash is because i ultimately imagine having fields for the client's hash like, "number-of-vists: 12" and then my program would be able to do stuff like (visit+ john) 14:46 offby1: I could whip up a tiny example to demonstrate if you'd like 14:47 em: so i would have a procedure (visit+ hash) which takes a hash and updates the right field in that hash. 14:47 offby1: I'd expect it to be (visit+ name) where name might be bound to "john" 14:47 em: name is just a string and not a hash? 14:48 offby1: when you say "do stuff like (visit+ john)", are you talking about writing (visit+ john) _in your program_, or are you instead talking about typing that _interactively at a REPL_ ? 14:48 em: when the program is finished i want to use it by doing stuff like going, (visit+ john) 14:48 offby1: sorry I'm not answering every question; it takes me so long to type that by the time I've finished answering one question you've already asked another 14:48 em: which will have the effect of changing john's hash to reflect he visited again. 14:49 offby1: I'll ask again: does ``doing stuff like going, (visit+ john)'' mean "typing interactively at a REPL", or does it mean "putting that code into the program's text" ? 14:49 offby1: this is very important 14:49 em: I think the former. 'typing it interactively at the REPL" 14:49 offby1: good 14:49 offby1: that makes sense 14:49 offby1: ok so the issue is this: your _program_ shouldn't have any variables like "john", but your interactive session certainly can, if you'd like. 14:50 em: in other words, when my program is complete each client has their own hash. One of the things in their hash is a key called "visits" and I want to be able to just go, at the repl, (visit+ john) and it changes the value of the 'visits' key. 14:50 offby1: you'd start out by typing something like (define john (get-client-by-name "john" all-my-clients)) 14:50 offby1: I think I understand 14:50 offby1: then you could indeed (visit+ john) 14:51 offby1: gimme 10 minutes; I'll write up something that should point in the right direction 14:51 em: okay i think i understand what you are saying, conceptually. 14:52 em: i am able, usually, to fill in the blanks when it comes to 'procedure'. I think I got locked into thinking of this as having a hash whos NAME is the same as the name of the client. 14:52 em: and i couldn't figure out how to dynamically create variables 14:53 (join) jonrafkind 14:54 em: i can make a (get-client-by-name ) procedure but are you saying that each time i use this program, before I can do (visit+ wendy) i have to first type (define wendy (get-client-by-name "wendy" all-my-clients) 14:57 (quit) cdidd: Remote host closed the connection 14:57 offby1: em: this is how I'd do it: http://ix.io/2fk 14:58 offby1: pretty much, yes. 14:58 (quit) synergizm: Ping timeout: 245 seconds 14:58 offby1: naturally you could get fancy and have a (e.g.) web front-end that asks for a name; you'd type "wendy", and it'd retrieve wendy's record and then let you fiddle with it. 14:58 (join) synergizm 14:58 offby1: all without having the symbol "wendy" anywhere in the code. 15:00 em: well I only have 170 clients so I guess I can type (define wendy (get-client-by-name "wendy" all-my-clients) in 150 times into the code itself. :/ 15:00 em: 170* 15:00 offby1: then ur doing it rong 15:00 offby1: why would you want to do that? 15:01 offby1: what problem does that solve that you cannot solve with my suggestion? 15:01 em: because if I have to each time i use it type (define wendy (get-client-by-name "wendy" all-my-clients) every single time that I turn on the program, then eventually I will do it more than 150 times anyway 15:02 em: the idea of this is to keep data on my clients in a fast way. (visit+ wendy) is fast. 15:02 em: (define wendy (get-client-by-name "wendy" all-my-clients)) 15:02 em: (visit+ wendy) 15:02 em: that's not so fast 15:03 offby1: now why on Earth would you need to do that each time you run the program? 15:03 em: i could just keep track of it on paper that fast 15:03 offby1: weren't you gonna write the data out to disk, and then read it back? 15:03 offby1: that sounds like the way to go 15:03 em: say i have turned on the program and wendy shows up. I want to record her visit. 15:03 em: what will I do? 15:03 em: I will want to do: (visit+ wendy) 15:03 offby1: oh, then you will indeed have to do _something_ like (visit+ (get-client-by-name "wendy" all-my-clients)) 15:03 offby1: there's no getting around that. 15:04 offby1: You can make it a bit easier to type 15:04 offby1: but you'll still need to type "wendy" and "visit+" 15:04 em: of course i dont mind typing wendy and visit+ 15:04 em: in my mind it works like this: (visit+ wendy) 15:04 em: because i had thought wendy was the NAME OF THE HASH for wendy 15:04 offby1: at best it'd be something like (visit+ "wendy") 15:05 offby1: well, I hope I've disabused you of that notion 15:05 offby1: (define (fancy-visit+ name-string) (visit+ (hash-ref *clients-by-name* name-string))) 15:05 offby1: should do just fine 15:05 offby1: just two little quote marks and it's all simple 15:06 em: i can tolerate (visit+ "wendy") 15:06 em: i'm already tolerating the parentheses. 15:06 offby1: if you absolutely insisted, you could make visit+ be a _macro_, instead of a function; then you could pass it an identifier like (visit+ wendy). But then all your names would have to be valid Scheme identifiers, which would probably be annoying eventually 15:07 offby1: for example, your client might be De Witt Clinton; you'd have to type (visit+ |De Witt|) 15:07 offby1: might's well use quote marks, says I. 15:08 em: this is what makes lisp/scheme kind of weird I think. To use a program you have to use drracket and then you have to talk to it in this funny way. 15:08 offby1: yes and no 15:08 offby1: you could indeed make this a web service 15:08 offby1: then you'd interact with an ordinary browser, and the pages would be ordinary forms 15:08 offby1: you could also make it a Unix-style command-line program: you'd type "/usr/local/visit-plus wendy" at the command line 15:09 offby1: lotsa options 15:09 em: is it plausible that i could build it to just work in drracket in this 'ugly' way, since im the only one using it anyway. But then take what i have made work in drracket and give it a web interface later? 15:09 offby1: most language don't offer _anything_ like "this funny way" of talking to a program 15:09 offby1: you can absolutely do that 15:09 em: offby1: that's a very good point. 15:09 em: offby1: that's a good point. really a lot of languages don't give you any way to talk to it like we are. 15:10 em: i guess other languages peole make the GUI or something. Not sure how it works in other languages. 15:10 offby1: in fact, since I'm guessing you're doing this for school, I wouldn't be surprised if you wound up getting and assignment to do just that (i.e., make a web service) 15:10 offby1: you can also make an old-fashioned GUI; that might be a tad easier than a web service 15:10 em: no its actually not for school believe it or not. That's one thing I will say :) 15:11 offby1: believe it or not, what you're doing is not a million miles from what I did last week with rudybot 15:11 em: offby1: this is actually for real use. I'm just using the generic word 'client' in order to protect my privacy. 15:11 offby1: sure sure 15:11 offby1: we're both dealing with hunks of information, indexed by short strings, which we want persisted to disk 15:11 em: offby1: that's pretty cool. But im certain I have few enough clients and each client has few enough data that I don't need to learn sql yet 15:11 offby1: you have "clients", I have "stuff people have said on IRC" 15:12 offby1: oh I am not recommending sql. 15:12 offby1: that was just a particular choice I made that seemed right for me. 15:12 em: okay cool 15:12 em: yes 15:12 offby1: For you I recommend simply "write" and "read". 15:12 em: hash tables is almost definitely the right thing here. 15:12 offby1: (which in fact is just what rudybot did until last week) 15:12 offby1: hash tables are absolutely the right thing. 15:13 em: some of the values in the hash will be lists. Like if I want to have a key for "satisfied?" the value might be a list like '(1 1 0 1 1 0 1 1 1 0) 15:13 em: where each 1 means they were, and each 0 means they were not, on that visit. 15:13 offby1: if you only have a few clients, if this were a real fancy gui thing, you'd not force your users to spell out their names; instead you'd provide a "completion" mechanism, or perhaps a big GUI dropdown 15:13 em: then i can retrieve their hash, and find that key, and get that list, and analyse it later. 15:14 offby1: sure sure 15:14 offby1: actually I hate to tell you, but sql might turn out to be a good choice, even though you don't have much data. 15:14 offby1: you just described a "visit" structure that's different from a "client" structure 15:14 offby1: I'm seeing a "client" table and a "visit" table ... :) 15:14 em: it surely could be possible. it seems like a very good idea to some day try to do it again but with sql. But for now I feel that would delay getting this done in a timely way. 15:14 offby1: each visit has a reference to exactly one client 15:15 offby1: sure sure 15:16 em: well yes. What i really had in mind was a hash for the client themselves. and then a key like "bio" and the value for bio would be another hash with keys like "name", "birthday" "address" etc. and then another hash like "visit" and in that a hash for the visit data. 15:16 em: etc 15:17 em: each client is represented by a hash of hashes if you get me. 15:19 offby1: you could indeed you a hash for each client; that'd work fine 15:19 offby1: BUT racket has these nifty things called "structs" which are a tad more convenient 15:19 offby1: e.g. when you define a struct, racket writes the "get-visits" and "set-visits" procedures for you 15:19 offby1: saves a lotta tedious boilerplate 15:20 offby1: s/you a hash/use a hash/ 15:20 offby1: "F--- me, I cannot type" -- Det. Shakima "Kima" Greggs 15:20 offby1: or did I already say that 15:20 offby1: as you can see from my paste, I used a function called "set-client-visits!" but didn't have to define it 15:21 em: that's very very good 15:22 asumu: Yeah, structs are better than hashes when your set of keys is fixed. 15:24 offby1 nods gravely 15:24 offby1: rudybot: can I get an "amen"? 15:24 rudybot: offby1: Amen 15:24 offby1: rudybot: share it, brother 15:24 rudybot: offby1: top-eval (pm "#scheme" "gabot: Are you my long-lost brother from Parsippany?") 15:24 offby1: *snicker* 15:25 em: offby1: racket is also understanding automatically your client-visits ? 15:25 em: etc? 15:25 offby1: yep, Try It And See™. 15:26 offby1: read the docs about "struct" 15:26 offby1: rudybot: doc struct 15:26 rudybot: offby1: http://docs.racket-lang.org/reference/define-struct.html#(form._((lib._racket%2Fprivate%2Fbase..rkt)._struct)) 15:26 em: it just takes (struct foo (bar baz quack)) and lets you do set-foo-bar! and use foo-baz 15:26 offby1: you don't _need_ to use structs but they're super-convenient 15:26 offby1: em: exactly; let's Try It And See™. 15:26 offby1: rudybot: (struct foo (bar baz quack)) 15:26 rudybot: offby1: Done. 15:26 offby1: rudybot: (define f1 (foo 1 2 3)) 15:26 rudybot: offby1: Done. 15:26 offby1: rudybot: (foo-bar f1) 15:26 rudybot: offby1: ; Value: 1 15:26 offby1: rudybot: (foo-frotz f1) 15:26 rudybot: offby1: error: reference to an identifier before its definition: foo-frotz in module: 'program 15:26 offby1: rudybot: (foo-baz f1) 15:26 rudybot: offby1: ; Value: 2 15:26 offby1: etc 15:26 offby1: nothin' to it 15:27 em: that's pretty neat 15:27 offby1: indeed 15:27 offby1: under the covers, I think your struct is just a vector, and functions like "foo-baz" are really "vector-ref" 15:27 offby1: at least that's the way old Lisps did it 15:27 samth: offby1: that's not true in racket 15:28 offby1: didn't think so 15:28 offby1: racket structs also have some fancy advanced features that you can ignore for now, like inheritance and guards and ... 15:28 offby1: the one caveat is: they're immutable by default, so you'll want to pass #:mutable when you define it. Watch: 15:28 offby1: rudybot: (set-foo-bar f1 99) 15:28 rudybot: offby1: error: reference to an identifier before its definition: set-foo-bar in module: 'program 15:28 offby1: but 15:29 offby1: rudybot: (struct foo (bar baz quack) #:mutable) 15:29 rudybot: offby1: Done. 15:29 offby1: rudybot: (define f1 (foo 1 2 3)) 15:29 rudybot: offby1: Done. 15:29 offby1: rudybot: (set-foo-bar f1 99) 15:29 rudybot: offby1: error: reference to an identifier before its definition: set-foo-bar in module: 'program 15:29 offby1: heh 15:29 offby1: rudybot: (set-foo-bar! f1 99) 15:29 rudybot: offby1: Done. 15:29 offby1: trust me that wouldn't have worked with the previous definition 15:29 offby1: rudybot: f1 15:29 rudybot: offby1: ; Value: #(struct:foo 99 2 3) 15:29 em: yes I know. I get you completely. 15:30 offby1: \o/ 15:33 (join) bitonic 15:44 (join) dobroerlanger 15:49 (quit) synergizm: Ping timeout: 245 seconds 15:53 crunchybumble: are the mzlib/* deprecated? 15:54 offby1: I think so, but I'm not certain 16:01 (join) realitygrill 16:03 samth: crunchybumble: mostly 16:03 samth: it's certainly all old, but some things are not provided in other places 16:05 (join) RacketCommitBot 16:05 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/HmmT2g 16:05 RacketCommitBot: [racket/master] Improve filter for `path-string?'. - Sam Tobin-Hochstadt 16:05 RacketCommitBot: [racket/master] Use the correct #%app for applications of `local' bound identifiers in the student languages. - Sam Tobin-Hochstadt 16:05 (part) RacketCommitBot 16:06 asumu: Oh wow, there is a mzlib/awk. 16:06 asumu: Neat. 16:06 asumu: (that should go in rash/awk ;)) 16:09 crunchybumble: If I want to override a method with multiple distinct signatures, how do I declare which one I want to override? 16:09 mithos28: is rash a Racket shell? 16:10 samth: rash is a not-yet-existing racket shell, i believe 16:10 crunchybumble: e.g. insert in text% 16:10 mithos28: ok, thats why I hadn't heard of it 16:10 samth: crunchybumble: i don't understand -- there's only one `insert' method 16:11 mithos28: crunchybumble: you make a function that handles all the cases 16:11 mithos28: If it wasn't a method I would say using case lambda, but you might need to use something else because it is a method 16:12 samth: mithos28: you can use case-lambda with methods 16:12 mithos28: How do you deal with the self argument? 16:13 mithos28: or is that hidden away? 16:13 crunchybumble: mhm. http://bit.ly/GLNf1s this was the bit I was talking about, because there are different looking signatures for the method. Both of your responses make perfect sense. I suppose handle the cases I'm interested in, and then (super ...) the rest. 16:14 mithos28: Ok so my class information is a bit rusty but (define/override insert (case-lambda …))) should do what you want 16:16 crunchybumble: thank you. 16:16 asumu: mithos28: Yeah, it's hidden away. 16:16 asumu: mithos28: Also, what samth said re: rash. 16:38 (quit) realitygrill: Ping timeout: 246 seconds 16:40 (join) dobroerlanger_ 16:40 (quit) dobroerlanger: Ping timeout: 245 seconds 16:41 (join) realitygrill 16:50 samth: eli: is there a reason my bug reports refuse to post? 16:50 samth: also, get-ffi-obj should name the resulting procedure 16:57 (quit) realitygrill: Quit: realitygrill 16:59 eli: samth: The names used to work. Looks like it was broken at some point. 17:11 eli sighs at tewk's general direction 17:14 jonrafkind: problems with -j2 again? 17:20 eli: No, just badly formatted code. 17:52 (quit) mceier: Ping timeout: 240 seconds 18:10 (join) MayDaniel 18:41 (quit) MayDaniel: Read error: Connection reset by peer 18:52 (join) mithos28_ 18:52 (quit) mithos28: Read error: Connection reset by peer 18:52 (nick) mithos28_ -> mithos28 19:07 (join) Sycamore 19:07 Sycamore: Hi... 19:08 Sycamore: (metafunction) 19:08 Sycamore: I am new to Dr. Racket. I would like to know how can I make recursive functions in defining metafiction? 19:09 offby1: let's break that question into two pieces. 19:10 offby1: 1) Question: "how can I make recursive functions"? Answer: write a function that calls itself, as in (define (foo) (foo)) 19:10 offby1: 2) Question: " ... in defining metafiction?" Answer: I have no idea what you're talking about. 19:10 offby1: NEXT 19:10 rapacity: rudybot: (begin (define (metafiction) (metafiction)) (metafiction)) 19:10 rudybot: rapacity: your sandbox is ready 19:11 Cryovat: offby1: How can I use Racket to find true love? 19:11 rudybot: rapacity: error: with-limit: out of time 19:11 rapacity: metafiction 19:11 offby1: rudybot: can you find someone to marry Cryovat ? 19:11 rudybot: *offby1: I'm always troubled with people of unknown mixed ethnicity. You think you're plain race A, you marry with a girl who's plain race A, and you get a child that's race B. Oops. Your great-great-great mothers had affairs... 19:11 rapacity: hmm, maybe they meant a macro? or an evaluator? 19:12 rapacity: I mean that's meta? 19:12 (join) dous 19:12 Sycamore: (define-metafunction iswim-mach [(apply-env E X) ,(let ([b (cdr (assq `X `E))]) (if (notvar b) b (apply-env `E b)))] ) 19:12 Sycamore: oops 19:14 Sycamore: nevermind... 19:14 rapacity: ah redex, no idea 19:22 asumu: Sycamore: did you solve it? Recursive metafunctions should "just work" 19:25 Sycamore: er... not yet 19:26 Sycamore: (define-metafunction iswim-mach [(apply-env E X) ,(let ([b (cdr (assq `X `E))]) (if #t;(notvar b) b (apply-env `E b)))] ) 19:26 crunchybumble: hm. so I've got a list of As, f: A -> string A, and I want to get back "a1 a2 ... an", that is, with explicit spaces inserted between every two elements. I expected (string-append (cdr (map (\x. (values " " (f x))) list))), but that's not working. 19:26 crunchybumble: What am I misunderstanding about values? 19:26 Sycamore: for example in here, it says error: apply-env: illegal use of syntax in: (apply-env (quasiquote E) b) 19:27 asumu: Sycamore: You've used , to escape back into Racket. You need to go back into Redex by using (term ...) 19:28 asumu: Also, it's probably easier if you do your environment lookup(?) using a metafunction rather than assq. 19:28 asumu: crunchybumble: values does not create pairs. 19:31 crunchybumble: I don't want pairs, per se. If mapping a function over a list gives me a list with that function applied to each argument. I want mapp that'll give me a list twice the size of the one I started with, with every other value being a particular value. 19:32 (join) lewis1711 19:33 Sycamore: I used backquote ` instead of term... But even after I changed back to (term...), it doesn't work 19:34 Sycamore: apply-env: illegal use of syntax in: (apply-env (term E) b) 19:37 asumu: crunchybumble: you might want to just use string-join actually 19:37 asumu: rudybot: doc string-join 19:37 rudybot: asumu: your sandbox is ready 19:37 rudybot: asumu: http://docs.racket-lang.org/reference/strings.html#(def._((lib._racket%2Fstring..rkt)._string-join)) 19:37 asumu: but you could write that alternative map yourself too. 19:38 asumu: Sycamore: The whole metafunction has to be in the term. 19:38 asumu: Err, the whole metafunction invocation. 19:38 asumu: Because (apply-env E b) is not a Racket expression, but a Redex term. 19:39 (quit) dzhus: Remote host closed the connection 19:40 Sycamore: Thanks asumu!! I got it! 19:40 asumu: You could also refactor this like [(apply-env E X) b (where b (lookup X E)) (side-condition (notvar (term b))] 19:40 Sycamore: I think I have totally misunderstood the usage of "term" 19:41 asumu: and [(apply-env E X) (apply-env E b) (where b (lookup X E))] 19:41 asumu: (or something like that) 19:41 crunchybumble: mhm. well asumu, now I'm bothered enough to do that, but I knew its a common enough operation where there should be a pre-baked solution 19:42 Sycamore: do you mean "lookup" is a built-in function that I can use? 19:42 (quit) dnolen: Remote host closed the connection 19:48 asumu: Sycamore: No, it's just a metafunction I made up. You could also define it as a function and do (where b ,(lookup (term E) (term X))) 19:48 asumu: (it's often useful to have lookup metafunctions for managing environments) 19:53 lewis1711: do you really have to name fields in a class different from their constructor names? 19:53 (join) dnolen 19:55 asumu: lewis1711: not if you use init-field. 19:56 lewis1711: it's in a class*. which is different than a class it seems 19:57 asumu: lewis1711: class* is just class with interfaces 19:58 asumu: and the init-field clause should be the same in both. 20:00 lewis1711: I see 20:00 lewis1711: why is that a separate thing? 20:00 lewis1711: class / class* 20:00 lewis1711: init field working, hooray 20:00 asumu: lewis1711: I think it's to keep the most common case (no interfaces) shorter to type. 20:01 asumu: Otherwise you'd have to type (class object% () ...) with the weird extra parens. 20:01 Sycamore: asumu: I see. Thanks a lot! 20:01 asumu: Sycamore: NP. :) 20:02 lewis1711: hmm, that init-field thing really should be in the very first example in the guide 20:03 (quit) Sycamore: Quit: Page closed 20:04 asumu: Yes, the class/objects guide could use some work. It does read like the paper it's based on. 20:04 (quit) yoklov: Quit: computer sleeping 20:04 asumu: I mean, the first sentence says "A class expression denotes..." :p 20:05 lewis1711: haha :D 20:06 lewis1711: I wonder how the guide would fair as a wiki 20:06 lewis1711: or a wiki in general. hmm 20:06 asumu: There's been discussion of a Racket wiki. The best we have right now is the github wiki page, which is not very useful at the moment. 20:09 lewis1711: I also have an issue where I am really, really terrible at reading how things work without explicit examples. 20:09 (quit) mithos28: Quit: mithos28 20:10 lewis1711: usually I see an example first, read an explination and work backwards from that 20:10 lewis1711: but I digress 20:11 lewis1711: can one auto generate getters and setters? 20:11 asumu: If you define a public field, get-field and set-field will work automatically. 20:12 asumu: I think it'd also be easy to write a macro that made getter/setter methods for you. 20:12 lewis1711: easy for you :) 20:13 lewis1711: ah fields 20:13 asumu: rudybot: (define-syntax-rule (get/set f id1 id2) (begin (define (id1) f) (define (id2 v) (set! f v)))) 20:13 rudybot: asumu: Done. 20:14 asumu: rudybot: (define point% (class object% (super-new) (init-field x) (get/set x get-x set-x))) 20:14 rudybot: asumu: Done. 20:14 asumu: rudybot: (send (new point% 5) get-x) 20:14 rudybot: asumu: error: #:1:18: new: expected name and value binding at: 5 in: (new point% 5) 20:14 asumu: rudybot: (send (new point% [x 5]) get-x) 20:14 rudybot: asumu: error: send: no such method: get-x for class: point% 20:14 asumu: Hmmm. 20:15 lewis1711: oh actually that sort of makes sense 20:15 lewis1711: I could copy rubys attr_accessor, attr_reader 20:16 asumu: rudybot: (define-syntax-rule (get/set f id1 id2) (begin (define/public (id1) f) (define/public (id2 v) (set! f v)))) 20:16 rudybot: asumu: Done. 20:16 asumu: rudybot: (define point% (class object% (super-new) (init-field x) (get/set x get-x set-x))) 20:16 rudybot: asumu: Done. 20:16 asumu: rudybot: (send (new point% [x 5]) get-x) 20:16 rudybot: asumu: ; Value: 5 20:16 asumu: There we go. 20:16 asumu: lewis1711: exactly. 20:18 asumu: Hmm. I wonder if it'd be useful for the `field` clause to take a keyword like #:get that lets you specify an accessor method name. 20:18 asumu: Maybe not worth it since the class system is already complicated. 20:18 lewis1711: macros seem fine. IIRC thats exactly what ruby does 20:20 (join) malkomalko 20:21 lewis1711: it'd be nice to autogenerate the get-x set-x based on x though. but that's a whole nother type of macro isn't it? syntax object orsomething 20:22 asumu: It'd be an unhygienic macro, since it constructs a new identifier by mangling an existing one. 20:23 asumu: Also, this macro gives you the option of using your own name convention. 20:23 asumu: Like potato-x and hot-potato-x. 20:37 (join) jeapostrophe 20:40 lewis1711: that's true 20:43 (join) mithos28-mobile 20:49 (quit) acarrico: Ping timeout: 246 seconds 20:54 lewis1711: asumu: what's wrong with it being hygienic anyway? 20:57 (join) mithos28 20:59 (quit) dous: Remote host closed the connection 21:00 (join) neilv 21:02 (quit) malkomalko: Remote host closed the connection 21:03 (join) acarrico 21:09 (quit) jonrafkind: Ping timeout: 272 seconds 21:10 asumu: lewis1711: hygiene is good. Or did you mean what's wrong with a macro that doesn't obey hygiene? 21:10 lewis1711: yeah that latter one 21:10 asumu: They don't obey lexical scope in ways that you'd expect. 21:12 asumu: Also, they're mysterious in that it's harder to figure out what bindings are in scope. 21:13 asumu: So if (get/set x) generated get-x and set-x, it's not obvious unless you already understand this macro that these names are bound. 21:14 lewis1711: don't structs do something similar though? 21:15 lewis1711: like if you have a struct foo with an x field, racket generets foo-x 21:15 asumu: Yes, they do. So there is a place for these kinds of macros, but they should be documented and well understood. 21:20 (join) RacketCommitBot 21:20 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/MLJvSQ 21:20 RacketCommitBot: [racket/master] add a preference to control whether or not there is an extra - Robby Findler 21:20 (part) RacketCommitBot 21:22 lewis1711: I think in general the class/object thing is to verbose. maybe filthy macros would solve it 21:23 crunchybumble: but sometimes its important to be able to break hygene 21:23 (quit) jeapostrophe: Ping timeout: 246 seconds 21:25 neilv: like when you're out camping 21:30 lewis1711: I suppose you're not really supposed to use objects in racket, and instead do something incredibly clever with recursion 21:30 crunchybumble: I was thinking the "if-it" example for instance 21:33 (quit) neilv: Quit: Leaving 21:43 (join) jrslepak 21:44 (join) fftb 21:47 (quit) bitonic: Quit: WeeChat 0.3.5 21:49 (join) vkz 21:50 offby1: lewis1711: Paul Graham has written entertainingly about OO versus Lisp 21:50 offby1: see e.g. http://paulgraham.com/noop.html 21:50 (quit) masm: Quit: Leaving. 21:53 lewis1711: meh :P 21:55 crunchybumble: I know there's a rule against complaining about open-source tools, but a few more well documented examples using the GUI framework would greatly help users of that framework and those simply using the object/class system 21:58 crunchybumble: that Graham blog is a nice read, and Rees's response is well put as well. 22:05 (join) jeapostrophe 22:10 chandler: crunchybumble: If our trolls are any indication, that rule doesn't seem to apply anymore. 22:11 chandler: I think a constructive comment to the users list talking about what you were looking for might be useful. 22:13 crunchybumble: oh, well. I'll sign up first, and we'll see. 22:21 asumu: crunchybumble: yeah, that's a known doc failure. We need more tutorial style docs. 22:22 asumu: But do post to the mailing list in case it leads to useful discussion. 22:23 crunchybumble: So, I'm looking to subclass a class method with multiple signatures. case-lambda was suggested, and that makes sense so far as it goes, but then one has to handle all possible combinations of required and optional arguments. 22:26 asumu: crunchybumble: what do you need the multiple signatures for? Maybe there is another thing that could solve your issue. Since case-lambda doesn't support optional args. 22:27 crunchybumble: well, I'm looking to build a subclass of text%, and I'm going to need to subclass the insert method http://bit.ly/GOL0bx 22:28 crunchybumble: err.. override 22:30 asumu: crunchybumble: Oh, right. Well unfortunately if you look at how insert is implemented in text%, it uses a giant case-lambda. 22:31 crunchybumble: I'd be just as pleased I guess to find the implementation of the class text% itself, but I can't seem to find that either. 22:31 asumu: collects/mred/private/wxme/text.rkt 22:33 asumu: crunchybumble: actually, what are you overriding insert for? In some cases, you might want to override a different method. 22:33 (join) realitygrill 22:33 asumu: For example, on-insert. 22:33 asumu: (or rather, augment since on-insert and after-insert are beta-style so you have to augment) 22:34 crunchybumble: I want the versions with string to insert be inserted as something other than a string-snip% 22:37 asumu: crunchybumble: you could just have a case-lambda with the snip case and then send all other calls to the superclass. 22:37 asumu: You can use a rest argument in the case lambda to avoid writing out all the cases. 22:39 crunchybumble: hm. yes, lemme think about how that's going to work. thanks 22:40 (quit) fftb: Remote host closed the connection 22:40 asumu: Like (case-lambda ([(snip) (if (snip? snip) (do-something) (super insert snip))] [rest (super insert . rest)]) 22:40 asumu: or something like that. 22:48 (quit) dnolen: Ping timeout: 244 seconds 23:02 (nick) samth -> samth_away 23:08 (quit) vkz: Quit: vkz 23:34 (join) yoklov 23:37 (quit) Nisstyre: Quit: Leaving 23:39 (join) Nisstyre 23:42 (quit) asdfhjkl: Quit: Leaving 23:56 crunchybumble: why aren't inherited fields capable of taking a default argument?