00:25 (join) jeapostrophe 00:48 jaimef: is there some sort of apache mod_racket? 00:49 mithos28: jaimef: what features do you want? run racket in apache? 00:50 mithos28: I haven't really used the web server, but what I remember being the simple way to integrate with apache was to run the racket web server behind it 00:50 mithos28: so that apache served the static files and racket served the dynamic content 01:00 (quit) jeapostrophe: Ping timeout: 240 seconds 01:02 vu3rdd: jaimef: there used to be mod_lisp. 01:03 jaimef: I got it compiled 01:06 vu3rdd: jaimef: I had used mod_lisp long back with guile. guile generated the dynamic content while apache served static ones. it used to work just fine. Have forgotten the details now. 01:17 freakazoid: ooh, match makes me feel like I'm back in Erlang land 01:52 (quit) freakazoid: Quit: Computer has gone to sleep. 02:12 jaimef: omg omg it built! 02:29 (quit) dnolen: Quit: dnolen 02:42 jonrafkind: doom3? 02:48 jaimef: hehe no but I should try 02:48 jaimef: 5.2 on netbsd 03:08 (quit) mithos28: Quit: mithos28 03:27 (join) Blkt 03:32 jaimef ponders how to parse log files with racket 03:33 (quit) jonrafkind: Ping timeout: 276 seconds 03:53 (join) ahinki 04:20 noelw: jaimef: Open and port and parse with regexps should work for most formats 04:53 (join) keenbug 05:15 (quit) keenbug: Ping timeout: 245 seconds 05:53 (quit) kenjin2201: Ping timeout: 245 seconds 05:55 (quit) vu3rdd: Remote host closed the connection 06:54 Blkt: good day everyone 06:54 noelw: Hi. A bit late for you 06:55 noelw: Normally you're on a good few hours earlier 06:55 noelw: Sorry, don't mean to sound like a nag 07:01 (quit) Shviller: Ping timeout: 240 seconds 07:01 (nick) Shvillr -> Shviller 07:01 (join) Shvillr 07:09 (join) keenbug 07:15 (quit) noam: Read error: Connection reset by peer 07:15 (join) noam 08:01 (quit) Shviller: Ping timeout: 258 seconds 08:12 (join) Shviller 08:23 (quit) noam: Read error: Connection reset by peer 08:23 (join) noam 08:57 (join) ZJF 08:58 (quit) ZJF: Client Quit 09:26 (quit) noam: Read error: Connection reset by peer 09:26 (join) noam 09:35 (nick) samth_away -> samth 09:47 (nick) QtorTheDestroyor -> TURBQISLAAM 09:53 (join) epsil 10:02 (join) jeapostrophe 10:11 epsil: is there a way to import all of R6RS in one fell swoop? 10:11 epsil: Instead of doing, say, (import (rnrs) (rnrs mutable-pairs (6))) just to get set-car! 10:11 (join) jakeskik 10:17 samth: epsil: no, i don't think so 10:25 epsil: ok 10:26 epsil: hm, geiser's autodoc won't display argument names, just underscores 10:26 epsil: like (foo.scm:baz _ _) 10:26 epsil: is there a way to make it more descriptive? 10:28 epsil: "... autodoc will display, instead of their value, the argument names (or an underscore if Geiser cannot determine the name used in the definition)" 10:29 epsil: but why wouldn't it be able to determine that for a function I've written myself? 10:30 bremner: different module? 10:32 epsil: I'm using #lang racket 10:34 epsil: hm, seems to work now ... weird 10:36 epsil: now it works for user-defined functions, but it cannot tell me anything about things that are defined in #%kernel 10:36 epsil: and it cannot display the source of #%kernel-defined functions (+, set!, ...) either 10:36 epsil: maybe that is why? 10:36 samth: right, those don't have "source" or "argument names" in the same sense 10:36 samth: also, `set!' is not a function 10:37 epsil: nah, of course it's not :) 10:37 epsil: but anyway 10:37 epsil: can autodoc display information about those? 10:38 epsil: or is there perhaps a (display-help 'set! ...) function I can enter at the REPL? 10:39 (join) masm 10:40 epsil: C-c C-d C-d does bring up a [manual] link, which works 10:43 epsil: but is there a way to display "(+ z ...)" in the minibuffer, instead of having to look up the manual entry for "+"? 10:47 (quit) jeapostrophe: Ping timeout: 260 seconds 10:47 samth: epsil: does C-c C-d C-s work? 10:49 epsil: samth: No, there is a "Not enough arguments for format string" error 10:49 samth: that sounds like a bug in geiser 10:51 epsil: yeah, but autodoc still shows up 10:52 epsil: with the cursor at "cons", I get this: (#%kernel:cons _ _) 10:52 epsil: is that right? or is something missing? 10:53 (join) freakazoid 10:56 samth: cons does have two arguments and is provided from #%kernel 10:57 samth: i don't use geiser, so i don't know if it's supposed to do more than that 10:58 epsil: hm 10:58 (quit) freakazoid: Quit: Computer has gone to sleep. 10:59 (quit) ahinki: Quit: ChatZilla 0.9.87 [Firefox 9.0/20111116091359] 11:09 (quit) keenbug: Ping timeout: 260 seconds 11:14 bremner: I seem to recall it is not so good at kernel functions 11:15 bremner: something about if/how the module has been imported. 11:16 bremner: in the actual case of cons, it isn't clear there is much more to say... 11:17 epsil: ah 11:17 epsil: well, as long as it's not an issue with my configuration 11:25 (join) jeapostrophe 11:56 (join) shofetim 12:14 (join) MayDaniel 12:27 (join) dnolen 12:31 (quit) Blkt: Remote host closed the connection 12:45 (join) jonrafkind 12:56 (quit) epsil: Ping timeout: 260 seconds 12:58 (quit) MayDaniel: Read error: Connection reset by peer 13:00 RacketCommitBot: [racket] plt pushed 6 new commits to master: http://git.io/32jH9w 13:00 RacketCommitBot: [racket/master] Fixing PR10485 - Jay McCarthy 13:00 RacketCommitBot: [racket/master] This fixes 10497 and potentially breaks programs that assume the query of a URL is always a list. I have fixed uses in the Web Server, which I expect is the major thing affected, but much more could be. Therefore I am skeptical this is a good idea just for the representation of ?. So, I'd like other people to review the change and let me know if they think I should revert it. - Jay McCarthy 13:00 RacketCommitBot: [racket/master] Forgot to include doc change - Jay McCarthy 13:09 (join) epsil 13:13 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/b5nVSw 13:13 RacketCommitBot: [racket/master] Revert "This fixes 10497 and potentially breaks programs that assume the query of a URL is always a list. I have fixed uses in the Web Server, which I expect is the major thing affected, but much more could be. Therefore I am skeptical this is a good idea just for the representation of ?. So, I'd like other people to review the change and let me know if they think I should revert it." - Jay McCarthy 13:13 RacketCommitBot: [racket/master] Revert "Forgot to include doc change" - Jay McCarthy 13:16 jaimef: anyone ever do log parsing with racket? 13:16 jonrafkind: which log 13:16 jonrafkind: you can probably just do the same thing other languages do: regexes 13:16 jaimef: unix logs 13:17 jonrafkind: since there is no rhyme or reason to syslog 13:17 bremner: syslog? 13:17 jaimef: need an rfc #? 13:18 jaimef: sure syslog is a good example but not 100% inclusive of the term "unix logs" :P 13:19 jonrafkind: theres an rfc for unix logs? 13:20 (quit) shofetim: Ping timeout: 252 seconds 13:20 bremner: uh, yeah. What RFC? 13:21 bremner suspects we have a failure to communicate 13:22 jaimef: I was making a joke, as you seemed very "tell me which log! this log? that log?" 13:23 bremner: well, if you want a library, which log is important 13:23 bremner: if you want general advice, I guess you already got it. 13:23 jonrafkind: lets get ice cream 13:24 bremner is in a snow storm, not sure I'm in the mood for ice cream 13:26 (join) shofetim 13:26 (join) francisl 13:36 (quit) epsil: Quit: WeeChat 0.3.5 13:45 (join) samth_ 13:57 jaimef: bremner: mostly did not want to try to do something ill suited for racket 14:03 (join) tyson2 14:05 (join) anRch 14:08 (join) freakazoid 14:41 (part) tyson2 14:54 (join) Indecipherable 14:55 (quit) anRch: Quit: anRch 14:55 Indecipherable: Has anyone ever thought of implementing CL in Racket 15:01 jonrafkind: yea.. 15:01 jonrafkind: I didn't get very far though 15:49 (part) Indecipherable 15:51 (quit) dnolen: Ping timeout: 265 seconds 15:57 (quit) masm: Ping timeout: 258 seconds 15:58 (quit) samth_: Quit: Ex-Chat 16:06 (join) MayDaniel 16:16 (quit) MayDaniel: Read error: Connection reset by peer 16:30 (join) ambrosebs 16:35 (part) snorble 16:36 (join) snorble 16:37 (quit) cataska: Ping timeout: 252 seconds 16:43 (join) cataska 16:49 (join) keenbug 17:20 (join) masm 17:33 (quit) jonrafkind: Ping timeout: 252 seconds 17:35 (quit) jeapostrophe: Ping timeout: 248 seconds 17:37 (join) anRch 17:51 (join) Curry 17:51 (nick) Curry -> RackN00b 17:53 RackN00b: Hello all! Just wondering if someone might be able to answer a question regarding lambda - specifically, lambda cannot recurse implicitly, correct? I mean for lambda to work on any sort of list that requires incrementing through that list, there has to be another function supplying the recursive data, no? 17:57 (quit) RackN00b: Remote host closed the connection 17:58 (join) jeapostrophe 17:58 (join) RackN00b 17:59 RackN00b: Hi sorry... for some reason my IRC client quit on me - is anyone around ? 18:00 (quit) keenbug: Ping timeout: 240 seconds 18:06 samth: RackN00b: i don't fully understand your question 18:06 samth: lambda is a syntactic form for creating functions 18:06 RackN00b: Well what I meant is that lambda is just an anonymous function and so can't recurse on its own, can it? 18:07 RackN00b: I was under the impression that in order to recurse, you need to re-apply the function to some smaller "value" working towards a base case... 18:07 RackN00b: With lambda being anonymous, how can you write a command that calls it ? 18:07 (quit) RackN00b: Remote host closed the connection 18:07 samth: RackN00b: yes, that's right, (lambda (x) ...) doesn't have a reference automatically to the function itself 18:07 samth: like this: 18:08 (join) RackN00b 18:08 RackN00b: Sorry - irc quit again - not sure if you said anything :( 18:08 samth: rudybot: (define len (lambda (l) (if (empty? l) 0 (+ 1 (len (rest l)))))) 18:08 rudybot: samth: Done. 18:08 samth: RackN00b: yes, that's right, (lambda (x) ...) doesn't have a reference automatically to the function itself 18:08 samth: see the function I just defined 18:09 samth: rudybot: (len (list 1 2 3 4)) 18:09 rudybot: samth: ; Value: 4 18:09 RackN00b: Right... the recursion is being handled by len 18:09 samth: yes 18:09 RackN00b: The reason I ask is this: As part of an assignment, I have to write a function that produces the powerset of a list of numbers. 18:09 samth: sure 18:09 RackN00b: That's a bonus question - the first one. 18:10 RackN00b: Which I have done using map and recursing on the numlist 18:10 samth: that makes sense 18:11 RackN00b: The second part is to do it without explicitly recursing. The third part is to do it using only the functions cons? cond empty? empty first rest and lambda. No locals, only one define statement for the whole thing. 18:11 RackN00b: The second part is already blowing my mind - I know I can re-write map using foldr but I still need to call it to recurse. The third part is blowing my mind because it seems that none of those functions inherently recurse on a list. 18:12 samth: RackN00b: this is a homework assignment, right? 18:12 RackN00b: Oh yes! 18:13 samth: so, i don't want to just give you the answer here 18:14 samth: have you seen how to write programs that run forever without explicit recursion? 18:14 RackN00b: No, No - I would hope not... 18:14 RackN00b: That's the thing, no... 18:14 RackN00b: Is there a particular name for that? 18:14 samth: ok, so here's a neat trick: 18:15 samth: rudybot: eval ((lambda (x) (x x)) (lambda (x) (x x))) 18:15 rudybot: samth: error: with-limit: out of time 18:15 freakazoid: Great, you'll slow the flow of programming drones who can barely turn on a computer coming out of college computer science courses by one. 18:15 samth: so, RackN00b, that program runs forever without recursion 18:15 RackN00b: What's wrong with drones? They do charlie-work! 18:16 RackN00b: what does eval do? never seem that before 18:16 samth: RackN00b: eval just tells rudybot to run a particular program 18:16 freakazoid: It evaluates expressions. 18:16 freakazoid: oh rudybot's eval 18:16 freakazoid: It evaluates expressions. 18:16 RackN00b: Is there a drracket equivalent? 18:16 freakazoid: that little area at the bottom 18:17 (quit) realitygrill: Quit: realitygrill 18:17 RackN00b: Oh, sorry - I see what you mean 18:17 freakazoid: there is also (eval expr) where expr is a quoted expression 18:17 freakazoid: not "" quoted, but like (eval '(+ 1 1)) 18:18 RackN00b: I see... So is that an example of two lambdas repeatedly feeding each other with the same parameter? 18:19 freakazoid: that's some combinator whose name I can't remember being applied to itself 18:19 RackN00b: Cause you're telling the first lambda to accept a parameter x (a function) and then applying it to itself? 18:19 freakazoid: well do it on paper 18:20 freakazoid: just substitute in the argument for the x's 18:20 RackN00b: So that's pretty cool -> but, how can you get it to stop? 18:20 freakazoid: it doesn't stop 18:20 (quit) cataska: Ping timeout: 244 seconds 18:20 freakazoid: it runs until it hits the edges of rudybox's sandbox 18:20 freakazoid: but maybe that's what you were asking - why doesn't it kill rudybot 18:20 freakazoid: rudybot is implemented using http://docs.racket-lang.org/reference/Sandboxed_Evaluation.html 18:20 RackN00b: cause it thinks it's constantly evaluating new parameters? 18:21 freakazoid: it is 18:21 freakazoid: if you do it on paper you'll see 18:22 freakazoid: A coworker of mine had a shirt that said "For a good time, call" and that expression 18:22 RackN00b: Haha. 18:22 RackN00b: So should I be looking at something like this for my function then? But if it won't end, how will I get the produced list in the end? 18:23 freakazoid: though I think it was written (λx.x) (λx.x) 18:23 freakazoid: err 18:23 freakazoid: (λx.x x)(λx.x x) 18:23 freakazoid: I don't know, I wasn't here when you first asked your question. 18:24 samth: RackN00b: that function won't solve your problem 18:24 samth: but it might give you an idea about how to run things for arbitrarily long times without explicit recursion 18:25 freakazoid: RackN00b: yeah, you're looking for a function that takes another function and makes it recurse :) 18:25 RackN00b: Oh - haha... Here she is: I need to consume a list of numbers and produce the powerset of that list. I have to do this three ways - first, which I've done is to use explicit recursion. No sweat. For the bonus, I need to write it without explicit recursion. Third way is to use only first, rest, empty? empty cons cond and lambda... it's an awesome problem! 18:25 RackN00b: Can you define walls on these sandboxes ? :P 18:26 freakazoid: Racket's sandbox functionality is quite powerful 18:26 freakazoid: you can define exactly what code in the sandbox is allowed to do 18:26 freakazoid: I haven't played with it yet, though. 18:26 freakazoid: I don't think I've ever seen more powerful sandbox functionality, even in Java 18:27 freakazoid: It's one of the reasons I like Racket, though. Nobody else seems to care about sandboxes 18:27 RackN00b: I don't know if that's the solution I am supposed to work with seeing as how we haven't covered anything like that yet - Is there another way? As an aside, is currying particularly useful, real-world ? 18:27 freakazoid: currying is very useful 18:27 samth: RackN00b: unless there's some trick that isn't obvious from your problem statement, i don't see another way 18:27 freakazoid: though scheme implementations generally use something called cut, which is sort of like currying and uncurrying 18:28 freakazoid: (define (add1 x) (cut + <> 1)) 18:28 freakazoid: err 18:28 freakazoid: that's wrong 18:28 freakazoid: (define add1 (cut + <> 1)) 18:28 RackN00b: Coolio. I'm a little confused as to why that function has been running for a while now and no memory-related message has popped up... if I accidentally invoke struc recursion without termination, it lets me know... 18:29 freakazoid: haha 18:29 samth: RackN00b: that function doesn't ever use any more space than it did at the beginning 18:29 freakazoid: Oh I guess it just never terminates 18:29 freakazoid: I thought it expanded - I never did it on paper :) 18:29 freakazoid: RackN00b: hint: don't pass it to itself. 18:29 samth: think about how it reduces, you'll see that it reduces to exactly itself 18:29 RackN00b: I defined curry as a bonus on my previous assignment as (define (curry f) (lambda (x) (lambda (y) ((f x) y))))) and uncurry as (define (uncurry f) (lambda (x) (lambda (y) (f x y)))) I think that's right... 18:30 RackN00b: Ok, another question on the issue of memory - we use an online submission system - if I were to write a function like that and submit it (Not that I have any intention of doing so - i have a pretty good relationship with the faculty!) does the halting problem not imply that there's no way for them to test if it terminates? 18:31 freakazoid: (uncurry (curry f)) should return the same function 18:31 freakazoid: or rather one that behaves the same 18:31 freakazoid: so if you start with a two argument function you should end up with a two argument function 18:31 RackN00b: ok 18:31 ozzloy: https://gist.github.com/1390220 how do i do cleanup after a test fails? i tried wrapping it in a with-handlers but i'm catching it 18:31 samth: RackN00b: probably, your course uses something like rudybot, with a timer 18:31 ozzloy: er... i'm not catching it* 18:31 RackN00b: a 18:31 ozzloy: the cleanup code doesn't run, the directory still exists 18:32 samth: ozzloy: you should probably use `test-suite' with the #:before and #:after keywords 18:33 ozzloy: those sound promising 18:33 ozzloy: samth, thanks 18:33 (join) cataska 18:34 ozzloy: so does test failure not actually raise an instance of exn:test:check ? 18:35 samth: ozzloy: you also aren't using the appropriate predicate there 18:35 ozzloy: or maybe i'm just reading this wrong? http://docs.racket-lang.org/rackunit/api.html?q=rackunit&q=error&q=find-files&q=filter 18:35 rudybot: http://tinyurl.com/7dmz3dk 18:35 (join) epsil 18:35 samth: you are missing a ? 18:36 (quit) anRch: Quit: anRch 18:36 epsil: what is the simplest way to create a small DSL within an enclosed context? 18:36 epsil: say I want to use "foo" as a shorthand for "foo-function", and I have a special form where such shorthands are allowed: 18:36 epsil: (special-environment (foo) (bar)) => (begin (foo-function) (bar-function)) 18:36 epsil: how would I go about implementing "special-environment"? 18:36 ozzloy: samth, same behavior with a ? 18:37 ozzloy: samth, i had it in my actual test, typoed it in this minimal example 18:37 samth: epsil: like this 18:37 epsil: :) 18:38 samth: rudybot: (define (foo-function x) x) (define-syntax-rule (special-env body ...) (let-syntax ([foo (make-rename-transformer #'foo-function)]) body ...)) 18:38 rudybot: samth: e.g. haskell: ("foo"++) python: (lambda x: "foo" + x) (or something) 18:38 samth: rudybot: eval (define (foo-function x) x) (define-syntax-rule (special-env body ...) (let-syntax ([foo (make-rename-transformer #'foo-function)]) body ...)) 18:38 rudybot: samth: Done. 18:38 samth: (special-env (foo 7)) 18:38 samth: rudybot: (special-env (foo 7)) 18:38 rudybot: samth: error: reference to an identifier before its definition: foo in module: 'program 18:38 samth: damn 18:38 samth: has to be more complicated 18:39 epsil: samth: thx, but say I wanted to use "and" as a shorthand 18:39 samth: do you have a more complete specification? 18:39 epsil: would all calls to "and" be affected, or only the top level? 18:39 samth: which do you want? 18:40 epsil: only the top level 18:41 samth: then just recur over the top-level things and replace the ones you want 18:41 samth: like this 18:41 (join) jonrafkind 18:41 (quit) francisl: Quit: francisl 18:41 samth: (define-syntax (special-env stx) (syntax-case stx () [(_ stuff ...) (map some-function (syntax->list #'(stuff ...)))]))) 18:42 epsil: so in other words, that's a bit like macro expansion 18:44 samth: yeah, that's what you want to do, isn't it? 18:45 epsil: yeah, pretty much 18:46 epsil: to make things more concrete 18:46 epsil: say I have a function named "parse-and", which is a parser combinator 18:46 epsil: to create a new parser I can do (parse-and parser1 parser2), but this is cumbersome 18:47 epsil: so what I want is a nice little DSL for my combinators where I can write (and parser1 parser2) instead 18:48 epsil: but, of course, the "parse-and" function may call the RACKET procedure "and", and I don't want my DSL to interfere with that 18:49 epsil: on the other hand, I do want to be able to nest "and" shorthands, e.g., (and (and parser1 parser2) parser3) 18:49 epsil: which would expand to (parse-and (parse-and parser1 parser2) parser3) 18:49 samth: so, you can certainly do taht 18:49 samth: that 18:50 samth: you'd just want to change the meaning of `parse-and' to look at its subcomponents, and see if any of them are `and', and change them to `parse-and' 18:50 (quit) jeapostrophe: Ping timeout: 244 seconds 18:52 epsil: hm 18:52 epsil: I want to do things in two steps 18:53 epsil: 1. transform (and (and ...)) to (parse-and (parse-and ...)) 18:53 epsil: 2. call the resulting expression 18:53 epsil: and there may be other shorthands as well, say "or". 18:54 RackN00b: So samth - you mentioned that that particular approach of a non-terminating function wouldn't work... Is that correct? 18:54 samth: epsil: yeah, that's fine 18:54 samth: it should all be pretty easy 18:54 samth: i'll try to make up an example in a sec 18:54 epsil: great 18:55 samth: RackN00b: you need to take the general idea of how that function manages to recur 18:55 samth: which is self-application, as you saw 18:55 RackN00b: I see. 18:55 samth: and figure out how to use that idea to make more useful functions 18:57 RackN00b: If I wanted to define a function using lambda that simply consed the first of a list onto the rest of the list would this be appropriate? (define (foo list) (lambda (x) (list (first x) (rest x))))) ? 18:57 RackN00b: I guess I'm slightly unsure of how to pass parameters to lambda 18:58 samth: lambda just creates a function 18:59 RackN00b: Sorry... my parens were off - I see that now : 18:59 RackN00b: parameters are supplied to sample just like any function (f x) where f is the function and x is the parameter... got it 19:02 samth: epsil: https://gist.github.com/1390297 19:02 samth: gotta run 19:02 (nick) samth -> samth_away 19:03 epsil: thanks! 19:04 (join) dnolen 19:04 (join) realitygrill 19:04 samth_away: wooo 70 racketeers :) 19:05 jonrafkind: I could make a few more bots join 19:07 epsil: time for sleep 19:07 epsil: thanks for all the help, samth 19:07 ozzloy: samth_away, thanks 19:08 ozzloy: oh wow, there's only 70 people in here? how is this room not more popular? 19:09 (quit) realitygrill: Client Quit 19:09 ozzloy: samth_away, i got it to work, but i'd like to know why the thing i was trying earlier didn't work 19:09 RackN00b: So I'm trying to filter a list of numbers such that only even numbers remain. My code is this: (define (foo2 list) 19:09 RackN00b: ((lambda (x) ((lambda (y) (cond 19:09 RackN00b: [(even? x) (cons x y)] 19:09 RackN00b: [else y]))(rest list)))(first list))) 19:09 ozzloy: RackN00b, are you not allowed to use filter ? 19:10 RackN00b: Well, this is a self problem but it applies to another where I can't use any abstract list functions. 19:10 ozzloy: icic 19:10 (quit) samth_away: Ping timeout: 260 seconds 19:10 ozzloy: T_T 19:10 RackN00b: The predicate is only being applied to the first item in the list. Can I initiate recursion in a manner similar to this? 19:10 jonrafkind: RackN00b, y is not bound in the even? clause 19:10 asumu: RackN00b: Your code doesn't seem to have any recursion in it. 19:10 asumu: Which will make it pretty hard to process a list, which is recursive. 19:10 (quit) epsil: Quit: WeeChat 0.3.5 19:11 RackN00b: asumu - I know that :d I'm trying to figure out how to recurse using only lambdas 19:11 RackN00b: y is bound to rest of list 19:11 asumu: Oh. Literally only lambdas? Or can you use define? 19:11 ozzloy: RackN00b, recurse using only lambdas? this looks like a job for... the Y combinator! 19:11 RackN00b: define as in...? a local definition? nope 19:11 RackN00b: y combinator eh? 19:12 ozzloy: yeah, that's exactly what the y-combinator does 19:12 asumu: RackN00b: Basically, the Y combinator is the pure lambda way of doing it. What I mean by define is that often you can get recursion by using names. 19:12 asumu: Which is what define lets you do. 19:12 RackN00b: holy jeebus - To the DrRacket documentation! 19:12 asumu: (give things names) 19:12 RackN00b: neat. 19:12 (join) realitygrill 19:13 asumu: RackN00b: Also, the documentation probably won't mention the Y combinator. 19:13 RackN00b: merde 19:13 (quit) masm: Quit: Leaving. 19:13 ozzloy: RackN00b, it took me a while to break down the y-combinator step by step. i searched a ton of the webses to get explanations for it 19:14 ozzloy: damnit 19:14 RackN00b: So the y-combintaor isn't something specific to racket or scheme, but a general cs concept? 19:14 ozzloy: i recorded a presentation of it 19:14 ozzloy: but never uploaded it to youtube 19:14 ozzloy: RackN00b, yes, correct 19:14 RackN00b: neat 19:14 ozzloy: you can see it on rosettacode 19:14 jonrafkind: the y combinator is purely academic 19:15 RackN00b: why is that jonrafkind? Cause there are simpler ways to do things you mean? 19:15 jonrafkind: because you can use define to achieve the same thing in a much easier way 19:15 ozzloy: http://rosettacode.org/wiki/Y_combinator 19:15 jonrafkind: the y combinator is for when you are using the pure lambda calculus, which no one uses to do anything real 19:15 RackN00b: as a side note - does anyone know if you can change the transparency of the definitions/interactions frams in drracket? 19:15 RackN00b: I see... 19:16 (quit) realitygrill: Client Quit 19:16 jonrafkind: (define (foo x) (foo (+ x 1))) <-- defines foo and which calls itself recursively 19:17 RackN00b: I wish I could use that :D 19:18 asumu: Your assignment won't let you? 19:18 ozzloy: i'm taking you at your word that you need to use just lambdas 19:18 ozzloy: have you examined that assumption? 19:18 asumu: It seems cruel to make you do that without teaching you the Y combinator. 19:18 jonrafkind: yes, the assignment is likely flawed or you are misunderstanding it 19:18 ozzloy: is this a homework assignment? 19:19 jonrafkind: otherwise its just sadism 19:19 RackN00b: Nope, confirmed with prof - is it a bonus question though, so it's not surprising that they're making us go above and beyond 19:19 RackN00b: Maybe peppered with a dash of sadism as well though 19:19 RackN00b: Only allowed to use: empty? empty cons cons? first rest cond and lambda 19:19 ozzloy: have you already learned how to do regular recursion with names? 19:19 RackN00b: Oh yeah 19:19 (join) realitygrill 19:20 RackN00b: It's a three part question - first is solving however we want - I used map and recursed on the list. Second part is without directly calling the function, which I imagine I can do with a lambda. Third is pure lambda 19:20 ozzloy: also i envy you being somewhere that uses racket in a programming course 19:21 ambrosebs: RackN00b: where are you studying? 19:21 RackN00b: waterloo 19:21 (quit) RackN00b: Remote host closed the connection 19:22 (join) RackN00b 19:22 RackN00b: Ah - sorry - client bailed again - man colloquoy is hating me tonight! 19:22 asumu: Go Canada. :) 19:22 ambrosebs: RackN00b: and why Racket? 19:23 RackN00b: They switch from Java a few years ago for the fundamental course. I think it's pretty cool. I have some experience with Fortran and VB so it's been a nice challenge to start thinking a little differently. 19:23 ambrosebs: wow 19:24 ambrosebs: my university just switched from Java to Python 19:24 ozzloy: https://gist.github.com/1390220 why doesn't this display "hello world!"? 19:24 RackN00b: Neat. 19:24 ozzloy: RackN00b, from java to racket? haha, oh wow 19:25 ozzloy: RackN00b, are you using the HtDP book? 19:25 RackN00b: So I've done a little reading on the Y combinator - it's defined as its own function and then called within others - no dice... only one define in total for the answer :( 19:25 RackN00b: Yeah HtDP, pretty good text I think. 19:25 RackN00b: I have really really good course notes and pretty awesome profs at the moment though so I've been using the notes a fair bit. 19:25 ozzloy: RackN00b, you don't need to actually define the y-combinator as a function 19:26 RackN00b: Eek - I'm looking at like 6 nested lambdas then - good times... 19:26 ozzloy: you can just have it as a lambda that gets applied to some other 19:26 ozzloy: extra credit, yeah! 19:28 asumu: ozzloy: Try using dynamic-wind instead of catching the exception. 19:28 RackN00b: That's what I'm trying now... 19:28 RackN00b: parens are killing me :D 19:30 ozzloy: RackN00b, paredit mode in emacs makes the parenpain go away 19:30 RackN00b: Have never used emac 19:30 ozzloy: neither had i several months ago 19:30 ozzloy: june-ish 19:31 RackN00b: Oh - did anyone ever answer about the opacity of the interactions and definitions windows in drracket? 19:31 ozzloy: till then i was a long time vim user 19:31 ozzloy: played golf and beat friends 19:31 RackN00b: Haha... 19:31 asumu: RackN00b: I doubt you can change the opacity. Any reason why you want to? 19:32 RackN00b: Not really - purely cause I like the look of it... I wanna be able to do all my coding in Terminal in OS X but I can't.... 19:32 RackN00b: (I just started using a Mac) 19:32 asumu: My guess (without having looked at it closely) is that it would involve hacking DrRacket. 19:32 ozzloy: RackN00b, rainbow-delimiters-mode in emacs does that kinda 19:32 ozzloy: it makes the parens muted colors 19:33 ozzloy: and makes them different colors with openers matching closers 19:33 RackN00b: But I can't run anything in emacs can I? 19:33 ozzloy: geiser 19:33 ozzloy: runs racket 19:33 ozzloy: hold on, phone 19:34 asumu: ozzloy: BTW, I am/was a long-time vim user. Now that I use emacs, I'm still a vim user (evil mode). ;) 19:34 RackN00b: geiser? 19:34 asumu: RackN00b: http://www.nongnu.org/geiser/ 19:35 RackN00b: Neat- I'll have to play around with this when I have some time! 19:38 RackN00b: Now to figure out how to write a non-recursive list function with the Y combinator (aka flux capacitor) 19:42 ozzloy: asumu, i'm still a vim user too, it turns out 19:43 ozzloy: RackN00b, have you learned how to do something like fibonacci sequence yet? 19:43 ozzloy: asumu, i'll look into that 19:45 ozzloy: asumu, er... that's cool and all, but i already have a solution for getting the behavior i want 19:45 ozzloy: asumu, i'm still curious why this code _doesn't_ do the behavior i want. i'm using test-suite with #:after to do the thing i want to do 19:47 ozzloy: gtg again. asumu thanks anyways! 19:50 asumu: ozzloy: Looks like rackunit's checks will install their own exception handler. 19:50 asumu: So it's probably caught before it gets to your handler. 19:53 RackN00b: Sorry.. had to run outside for a sec... I did fibonacci abd factorial both with explicit recursion and now I'm working on some lambda only functions... tricky 19:58 (join) jeapostrophe 20:22 (quit) jonrafkind: Ping timeout: 240 seconds 20:31 (join) kenjin2201 20:39 (quit) jeapostrophe: Ping timeout: 248 seconds 20:49 (quit) kenjin2201: Read error: Connection reset by peer 21:03 (quit) acarrico: Ping timeout: 276 seconds 21:08 (join) kenjin2201 21:17 (quit) ambrosebs: Ping timeout: 245 seconds 21:47 (join) jeapostrophe 21:54 (quit) realitygrill: Quit: realitygrill 21:59 (quit) jeapostrophe: Ping timeout: 240 seconds 22:09 RackN00b: Anyone guide me with regards to the y-combinator? Does anyone know of any sample code that uses y-combinator that does what i want - I'm beyond caring about submitting it - I'm just miffed that I can't figure it out! 22:15 (join) realitygrill 22:17 RackN00b: anyone ? 22:17 RackN00b: :( 22:21 offby1: Not me. 22:21 offby1: y-combinator always confused me 22:21 RackN00b: It's awesome but when I've got like seven lambda expressions it' gets ridiculous... I'll bet the solution is like three lines or something... 22:26 freakazoid: haha 22:26 freakazoid: you've already seen the y combinator 22:27 freakazoid: or at least something very close to it 22:30 freakazoid: RackN00b: if the function can't directly recurse (because, for example, it doesn't have a reference to itself at definition time), how might it actually get a reference to itself to call in order to loop? 22:33 (join) jeapostrophe 22:36 (quit) RackN00b: Quit: RackN00b 22:37 (join) RackN00b 22:37 RackN00b: Through another function that its consuming, no? 22:38 RackN00b: I am starting to grasp the concept of the y-combinator but I wish there was a step-by-step method to attack the problem starting from the implicitly recursing function I do have... 22:38 RackN00b: Oh well, it's a moot point now, submitted already :P 22:59 (join) vu3rdd 22:59 (quit) vu3rdd: Changing host 22:59 (join) vu3rdd 23:25 (join) jonrafkind 23:29 (quit) RackN00b: Quit: RackN00b 23:31 (quit) kenjin2201: Read error: Connection reset by peer 23:50 (quit) jeapostrophe: Read error: Connection reset by peer 23:53 (join) jeapostrophe 23:54 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/XMPNHg 23:54 RacketCommitBot: [racket/master] Started on random testing for contracts - Andy Gocke 23:54 RacketCommitBot: [racket/master] Some small cleanups of Andy's contract generator code - Robby Findler