00:21 (part) yoklov: "bye!" 00:21 (join) yoklov 00:37 (quit) kmklz: Quit: leaving 00:42 (quit) yoklov: Quit: bye! 01:07 (quit) realitygrill: Quit: realitygrill 01:31 (join) jeapostrophe 01:43 (quit) jeapostrophe: Ping timeout: 252 seconds 01:53 (nick) chaozzbubi -> ChaozZBubi 02:20 (nick) novato_nl -> Kartagisz 02:49 (quit) jonrafkind: Ping timeout: 252 seconds 02:56 (join) snearch 03:00 (nick) ChaozZBubi -> chaozzbubi 03:29 (join) Blkt 03:30 Blkt: good morning everyone 03:49 (quit) Shviller: Ping timeout: 252 seconds 03:49 (join) Shviller 03:50 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/Acrr-w 03:50 RacketCommitBot: [racket/master] New Racket version 5.2.1.2. - Eli Barzilay 03:53 (join) ahinki 03:55 (quit) karswell: Read error: Connection reset by peer 03:56 (join) karswell 04:12 (join) sindoc 04:19 noelw: hi 04:23 (join) gciolli 04:50 (quit) snearch: Quit: Verlassend 05:09 (quit) dsantiago: Ping timeout: 244 seconds 06:04 (join) veer 06:24 (nick) chaozzbubi -> ChaozZBubi 07:12 sindoc: What's with the '|' delimiter in '|#:a| after evaluating (string->symbol 07:12 sindoc: (string-append 07:12 sindoc: "#:" "a")) ? 07:13 (quit) Demosthenes: Read error: Connection reset by peer 07:13 sindoc: rudybot: (string->symbol 07:13 sindoc: (string-append 07:13 sindoc: "#:" "a")) 07:13 rudybot: sindoc: You can use symbol->string to get the string version of a symbol (though changes to the string will not alter the symbol), and string->symbol will intern the string as a symbol. 07:14 (quit) gciolli: Ping timeout: 244 seconds 07:24 (join) masm 08:03 noelw: sindoc: | is a delimiter for things that wouldn't otherwise be read as symbols 08:03 noelw: In this case, starting with a hash would cause problems 08:23 (join) jeapostrophe 08:29 sindoc: noelw: Indeed. I was hoping to generate a list of keywords, given a list of syntax objects in a macro and I assumed the hash should be there. 08:30 noelw: The vertical bars are an artefact of printing the symbol 08:31 noelw: rudy-bot: (symbol->string '|#a|) 08:31 noelw: oops 08:31 noelw: rudybot: (symbol->string '|#a|) 08:32 rudybot: noelw: your sandbox is ready 08:32 rudybot: noelw: ; Value: "#a" 08:32 noelw: They don't actually form part of the symbol's name. 08:37 (join) EmmanuelOga 08:39 (quit) jrslepak: Quit: This computer has gone to sleep 08:39 sindoc: noelw: nevertheless, they are there and I'd rather they weren't :| 08:40 sindoc: let's say I have input: '(a b c) 08:40 noelw: Ok, but they are only there when you write the symbol 08:40 sindoc: I want to generate output: '(#:a #:b #:c) 08:40 noelw: rudybot: (display '|#a|) 08:40 rudybot: noelw: ; stdout: "#a" 08:41 noelw: rudybot (write '|#a|) 08:41 noelw: rudybot: (write '|#a|) 08:41 rudybot: noelw: ; stdout: "|#a|" 08:42 bremner: eli: (or others that use the handin-server), is there something obviously wrong with my checker.rkt? http://paste.debian.net/151670/ It seems like it isn't run at all, since any file even garbage, is accepted. 08:43 sindoc: noelw: (write …) includes the delimiters 08:44 noelw: Sorry, don't understand the problem. If you don't want the delimiters, don't write them -- display them. 08:45 sindoc: How would one transform '(a b c) into '(#:a irc://irc.freenode.net:6667/#:b irc://irc.freenode.net:6667/#:c) ? 08:54 (join) sindoc1 08:54 (quit) sindoc: Read error: Connection reset by peer 09:13 (join) bill_h 09:14 sindoc1: (let ((proc (λ (#:a a) a))) 09:14 sindoc1: (keyword-apply 09:14 sindoc1: proc 09:14 sindoc1: (list 09:14 sindoc1: (string->symbol 09:14 sindoc1: "#:a")) 09:14 sindoc1: '(1) '())) 09:15 sindoc1: The above code illustrates the problem 09:24 aidy: Is this a normal way of doing data structures in scheme? http://aids.diddyinc.com/pub/ 09:32 noelw: aidy: no, looks like some odd OO kinda system 09:33 aidy: why? 09:39 (quit) ernst: Ping timeout: 240 seconds 09:39 (quit) kmc: Ping timeout: 240 seconds 09:39 (quit) gabot: Ping timeout: 240 seconds 09:40 (topic) -: Racket -- http://racket-lang.org -- logs @ http://racket-lang.org/irc-logs 09:40 (names) -: gabot kmc ernst_ bill_h sindoc1 EmmanuelOga jeapostrophe masm veer karswell ahinki Shviller Blkt cataska AlbireoX kandinski mario-goulart freakazoid jschuster_away stchang noelw SeanTAllen aidy hyko ozzloy m4burns jrslepak_ samth_away shachaf Kartagisz dspt jamessan eli ChaozZBubi PfhatWork bfulgham acarrico elliottcable stamourv zerokarmaleft Oxryly rsimoes shadgregory SHODAN bremner Shvillr cipher sethalves abbe snorble gf3 danking tauntaun @ChanServ tonyg 09:40 (names) -: cky rudybot offby1_ petey` asumu em eMBee _p4bl0 GeneralMaximus mattmight chandler rapacity offby1 09:45 (quit) stchang: Read error: Operation timed out 09:46 (join) realitygrill 09:47 (quit) danking: Ping timeout: 240 seconds 16:33 (topic) -: Racket -- http://racket-lang.org -- logs @ http://racket-lang.org/irc-logs 16:33 (names) -: gabot jonrafkind sstrickl dsantiago jeapostrophe kanak stchang stamourv danking kmc ernst bill_h masm karswell Shviller cataska AlbireoX kandinski mario-goulart freakazoid jschuster_away noelw SeanTAllen aidy hyko ozzloy m4burns jrslepak_ samth shachaf Kartagisz dspt jamessan eli ChaozZBubi PfhatWork bfulgham acarrico elliottcable zerokarmaleft Oxryly rsimoes shadgregory SHODAN bremner Shvillr cipher sethalves abbe snorble gf3 tauntaun @ChanServ tonyg cky 16:33 (names) -: rudybot offby1_ petey` asumu em eMBee _p4bl0 GeneralMaximus mattmight chandler rapacity offby1 16:46 (join) snearch 16:56 (join) yoklov 16:58 (join) jao 17:24 RacketCommitBot: [racket] plt pushed 4 new commits to master: http://git.io/0kqFJQ 17:24 RacketCommitBot: [racket/master] Caching with weak boxes, cleanup, planet download icon - Neil Toronto 17:24 RacketCommitBot: [racket/master] Contract fix - Neil Toronto 17:24 RacketCommitBot: [racket/master] Rewrote flomaps and rendering in Typed Racket for speed and safety - Neil Toronto 17:28 (quit) snearch: Quit: Verlassend 17:38 (join) DanBurton 17:47 (part) rsimoes 18:10 (quit) karswell: Read error: Connection reset by peer 18:10 (join) Daminvar 18:11 (quit) jeapostrophe: Ping timeout: 276 seconds 18:12 (nick) jschuster_away -> jschuster 18:21 (quit) gf3: Quit: LOLeaving 18:22 (join) gf3 18:40 (quit) sstrickl: Quit: sstrickl 18:47 (join) CurryMan 18:49 CurryMan: Hey there. Interesting question: How would you write a function in very low-level student language that consumes four integers, the first of which is either 0,1 or 2. The function produces the second integer if the first = 0, the third if it's 1 and the fourth if its 2.... all WITHOUT using cond or if? A guy in the class beneath me asked me (it's on his assignment) but I couldn't figure it out! Any ideas, for my own curiosity ? 18:51 CurryMan: I'm thinking it's got to be some mathematical function but I don't know. 18:52 jonrafkind: something like b * first + a * first-1 + c * first-2, eh 18:52 jonrafkind: hm.. 18:53 CurryMan: I was thinking something with exponents but it's killing me. Now that I've been sidetracked by this, I'm not going to work on my own Calc III problem set until I figure it out :P 18:54 CurryMan: Or maybe putting the three integers a,b,c in a list and somehow calling out whichever place is (i-1)th in the list? 18:54 jonrafkind: this sounds like a strictly number theory related problem, rather than something to do with CS 18:54 jonrafkind: yea if you had list-ref you could do (list-ref (list a b c) first) 18:55 jonrafkind: or maybe its called nth 18:55 CurryMan: The guy said it was bonus problem. I remember the course well, all the bonus problems were mathy. Don't have list-ref, they're super low-level student. 18:55 jonrafkind: seems its there, list-ref 18:55 jonrafkind: its in beginning student 18:55 CurryMan: really? Oh. 18:58 cky: So, I'd like to write a circular list literal. Example: #0=(1 2 3 . #0#). 18:58 CurryMan: Hm. I'm kinda bummed. I was hoping there was a clever math-y way to do it. Actually there has to be because he mentioned the rules stipulate that they can't use anything they haven't covered and he mentioned they didn't even get to lists yet. 18:58 cky: rudybot: (write '#0=(1 2 3 . #0#)) 18:58 rudybot: cky: you can write a function to do that. CEDET is providing you a suitable API that makes it easy to manipulate semantic tags. 18:59 cky: rudybot: eval (write '#0=(1 2 3 . #0#)) 18:59 rudybot: cky: error: #:1:8: read: #..= expressions not allowed in read-syntax mode 18:59 cky: But see, that's not possible. Instead I have to use, say, read. 18:59 cky: rudybot: (write (call-with-input-string "#0=(1 2 3 . #0#)" read)) 18:59 rudybot: cky: ; stdout: "#0=(1 2 3 . #0#)" 18:59 cky: So, is there a better way? 19:02 samth: rudybot: (require racket/shared) 19:02 rudybot: samth: your sandbox is ready 19:02 rudybot: samth: Done. 19:02 samth: rudybot: (shared ([x (append (list 1 2 3) x)]) x) 19:02 rudybot: samth: ; Value: #0=(1 2 3 . #0#) 19:03 samth: cky: ta da 19:03 cky: samth: :-O 19:03 cky: Wow, that's like letrec for data structures. :-) 19:03 samth: cky: yup 19:04 samth: rudybot: doc shared 19:04 rudybot: samth: http://docs.racket-lang.org/reference/shared.html#(form._((lib._racket%2Fshared..rkt)._shared)) 19:04 cky: Cool. Thanks! I learnt something new. :-) 19:05 (join) jeapostrophe 19:09 Oxryly: can someone here answer some questions about racket modules and namespaces and load? 19:10 (nick) jschuster -> jschuster_away 19:12 samth: Oxryly: sure 19:13 Oxryly: samth: cool, I have an implementation of a domain specific language that is a superset of scheme/racket 19:14 Oxryly: in that implementation, I do a (load ".dc") 19:14 jonrafkind: 1000 racketers groan at the usage of 'load'.. 19:14 Oxryly: during that load I capture 'define'ed things into internal lists, massage those things then export them as binary data 19:15 Oxryly: jonrafkind: yes, that's my motivation for making a change ;) 19:15 Oxryly: so, I'm wondering if there's a better way (using require?) 19:16 jonrafkind: use require 19:16 (quit) DanBurton: Quit: Leaving 19:17 samth: Oxryly: yes, use require 19:17 Oxryly: ok, but I'm doing the load in an expression context right now in order to capture those definitions... 19:17 (join) jrslepak 19:18 Oxryly: in particular at the repl someone can type (make "file.dc") and that must read+eval the file then export certain definitions 19:18 Oxryly: "require: not at modujle level or top level in: ..." 19:19 Oxryly: I feel like I'm working from the wrong point of view 19:22 Oxryly: I have created a problem I cannot solve....... 19:26 CurryMan: For anyone interested in the question I asked - you can write the function as a Lagrange polynomial in one line :D neat. 19:27 jonrafkind: lulz 19:27 jonrafkind: I dont even know what that is 19:27 CurryMan: Also, unrelated... Can I somehow modify (random) to produce a bias distribution? 19:27 CurryMan: http://en.wikipedia.org/wiki/Lagrange_polynomial 19:29 Oxryly: so anyone have any advice on doing a require within an expression context? 19:30 cky: Oxryly: You mean you want to require a module that isn't specified as a literal? 19:30 jonrafkind: CurryMan, I think you can do the original problem just wth and's and or's 19:30 cky: If so, my first question for you is...why?! 19:30 jonrafkind: (or (and (= first 0) a) (and (= first 1) b)) (and (= first 2) c)) 19:31 Oxryly: cky: yeah that's the issue. right now do it can be invoked on the REPL 19:31 Oxryly: cky: searching for other reasons... this is a larg-ish legacy Scheme codebase 19:31 CurryMan: I should mention that it is for an assignment but I've already submitted for full points, so it's no biggie. Basically, we're playing a guess game where there's an implementation module that generates a random number between 1 and n. My task was to write something that guesses that number and produces the total number of guesses it took. My first approach was to start at 1 and increment, counting along the way until I got the correct answe 19:31 CurryMan: second approach, for the bonus, was to randomly pick a number in the range, if it was wrong, it added that number to a list and recursed. If it was correct it returns the length of that list. I got full points for that approach but I the prof mentioned that when they test the bonus, they don't choose a random number, they pick something usually close to n, so I was hoping to write something that would consume even fewer guess knowing that 19:32 CurryMan: jonrafkind: But that would still require a cond cause the result of that is a boolean, no? 19:33 jonrafkind: what does a cond have to do with it 19:33 jonrafkind: rudybot (= 2 3) 19:33 jonrafkind: rudybot: (= 2 3) 19:33 rudybot: jonrafkind: your sandbox is ready 19:33 rudybot: jonrafkind: ; Value: #f 19:33 CurryMan: rudybot (and #t 8) 19:33 CurryMan: oops... 19:34 CurryMan: What does (and #t 9) return? 19:34 jonrafkind: rudybot: (let ([first 2] [a 8] [b 12] [c 100]) (or (and (= first 0) a)) (and (= first 1) b)) (and (= first 2) c))) 19:34 rudybot: jonrafkind: Well. I’m using a nightly build and yas 0.6.1c. 19:34 jonrafkind: #t 19:34 jonrafkind: no wait, 9 19:34 jonrafkind: heh 19:34 CurryMan: rudybot: (random 50) 19:34 rudybot: CurryMan: your sandbox is ready 19:34 rudybot: CurryMan: ; Value: 45 19:34 jonrafkind: anything thats not #f is considered #t in racket 19:35 jonrafkind: rudybot: (and #t 5) 19:35 rudybot: jonrafkind: ; Value: 5 19:35 jonrafkind: rudybot: (and #f 5) 19:35 rudybot: jonrafkind: ; Value: #f 19:35 CurryMan: In student level as well ? 19:35 jonrafkind: hm.. good question 19:35 CurryMan: nope.. just checked :P 19:36 CurryMan: So any idea on modifying random to produce a bias distribution? 19:36 CurryMan: *biased rather 19:36 jonrafkind: I doubt its in the standard racket utilities.. 19:36 CurryMan: Bummer 19:37 jonrafkind: it might bein doug williams science collection 19:37 CurryMan: hmm 19:38 samth: Oxryly: what is the value produced by the thing you're loading? 19:43 Oxryly: samth: its a record instance 19:44 samth: Oxryly: why not provide it under a particular name 19:44 samth: then you can just require it 19:44 samth: and reference the name 19:44 samth: or use `dynamic-require' 19:44 Oxryly: ah, dynamic-require... forgot about that one. 19:45 Oxryly: unfortunately I need to extract a list of the things provided or defined by what I'm loading in order to export them 19:46 samth: hmm 19:46 samth: this is where the "large legacy code base" comes in 19:47 Oxryly: yeah, this is the system Matthew Flatt referenced in his CACM article. We use it making the Uncharted series of PS3 games. 19:48 Oxryly: I put it together coming from a pretty spare r5rs viewpoint 19:48 jonrafkind: you worked on unchared? 19:48 jonrafkind: uncharted* 19:48 Oxryly: yup 19:50 samth: Oxryly: i'm still not 100% clear on what exactly you're doing with load 19:50 jonrafkind: was that the game that a presentation was made about it talking about scripting with racket? 19:51 Oxryly: samth: using it to read+eval a file that is in a superset of scheme while 'define' is rebound to something that adds definitions to my internal lists 19:51 Oxryly: jonrafkind: that's the one 19:51 samth: Oxryly: ah, ok 19:51 samth: that's much easier, ironically 19:52 samth: you should rebind `define' to something that mutates the internal lists, and then just use require 19:52 Oxryly: I just finished hooking up to the PS3's dev tools using the new FFI. pretty cool. 19:52 jonrafkind: im jealous that you probably have access to the official ps3 sdk.. I have to use psl1ght :/ 19:52 samth: alternatively, you could have the language create a list, put the definitions in the list, and then export the result 19:53 samth: but i have to go 19:53 Oxryly: samth: ok... and I use dynamic-require since I need to use it in a expression context.... 19:53 samth: yes 19:53 samth: Oxryly: i recommend an email to the mailing list about your issue, though, so that someone can provide a more complete answer with slightly higher latency :) 19:53 Oxryly: samth: cool, thanks. see you later. 19:53 (nick) samth -> samth_away 19:55 Oxryly: jonrafkind: yes... I'm doing first party development 20:02 (quit) Daminvar: Quit: leaving 20:30 (nick) ChaozZBubi -> chaozzbubi 20:34 (quit) jonrafkind: Ping timeout: 276 seconds 20:57 (quit) stchang: Read error: Operation timed out 20:57 (join) stchang 21:01 (join) realitygrill 21:26 (quit) jeapostrophe: Ping timeout: 240 seconds 21:46 offby1: Party development! 21:46 offby1 turns up the music 21:51 (join) Mathieu 21:53 (join) dnolen 22:31 (quit) masm: Ping timeout: 252 seconds 22:48 (join) jonrafkind 22:55 (join) jeapostrophe 23:19 (join) Demosthenes 23:23 (join) tyson1 23:23 (quit) tyson1: Client Quit 23:25 (quit) SeanTAllen: Remote host closed the connection 23:45 (quit) dnolen: Read error: Connection reset by peer 23:46 (join) SeanTAllen 23:51 (quit) Demosthenes: Read error: Connection reset by peer 23:51 (join) Demosthenes 23:51 (join) dnolen