00:27 Demosthenes: so, should i try to stay pure to racket and not use anything but local recursion, or go ahead and use the loop contructs like for? 00:29 eli: There's no reason to avoid `for' -- unless you want to go with the illusion of "portable scheme code"... 00:30 offby1 chuckles 00:30 Demosthenes: not really, just reading the 'fixnum days' tutorial 00:30 offby1: I do try to disillusion people about portability. 00:30 Demosthenes: i remember the CL issues with loop 00:30 Demosthenes: ok, not issues. vindictive arguments 00:31 eli: IIRC, the main issues people have with CL's `loop' is that it's a mini language in its own right, whereas racket's `for/*' macros are more in-line with the language. 00:32 Demosthenes: yeah 00:32 Demosthenes: loop also had issues with proper scoping, etc. someone wrote ITERATE to use similar language in s-exps 00:33 Demosthenes: it was handy sometimes, but not others 00:34 chandler: eli: Regarding `and', I'm honestly not very enamored with it at all. I'd probably rather it was an ordinary function. 00:34 eli: Demosthenes: BTW, the fixnum days tutorial is *very* old. Especially around the macros neighborhood. 00:35 eli: chandler: That's something I'd strongly disagree with... 00:35 eli: IMO it's important to preserve tail-positions wherever possible, as part of a "things just work" feature that tail call elimination buys you. 00:36 chandler: `and' currently suffers from the same wart as `if' - namely, it leads people to write functions that confuse signaling of presence with domain results. 00:36 chandler: It also confuses those new to the language, who usually expect to be able to do something like (apply and some-list), only to discover that what they're looking for is not called `and'. 00:37 eli: Right -- but those people expect `and' to be similar to a short-circuiting `&&' in other languages. 00:38 eli: In any case, we've been through that flamewar semi-recently on the dev list. 00:38 offby1: chandler: can you explain what you mean by "signaling of presence" and "domain results"? 00:39 chandler: eli: Oh, I haven't been following that. 00:39 chandler: offby1: Having a function which returns #f (or NIL, in CL) when something is not found, and some other object when it is found. 00:40 chandler: I've been bitten multiple times by the confusion between "nothing was found" and "NIL was found" in a multi-100kloc commercial CL codebase. As a result, I tend to dislike that kidn of function very much, and without it I don't see a reason for things like `if' and `and' to accept non-booleans. 00:40 eli: offby1: IOW, it's the fact that #f is used in idiomatic scheme code in a similar way to NULL in C or many other `null's. 00:43 offby1 is too distracted to understand, but that's OK 00:44 eli: offby1: Something like (define my-window #f) 00:44 chandler: SRFI-1 `find' is a perfect example of this problem. 00:44 eli: and later on (set! my-window (make-a-window)) 00:44 eli: So #f is used as a "not initialized". 00:45 eli: Or, what chanler mentioned, the many places where #f is used to signal a "not found" result. 00:45 eli: Including things like optional arguments where #f is used for an optional that is not provided. 00:45 chandler: I'm less irritated by that - if you know that `my-window' is not valid unless it satisfies `window?', then there's no domain confusion. 00:46 eli: The domain confusion is resolved in all of these cases by an "option type", which in typed racket is (U #f TheRealType). 00:48 chandler: Multiple values are often used to implement that. Another possibility is to provide the user with the ability to specify the value returned when something is not found. 00:48 eli: Yeah -- a failure thunk is common in racket. 00:49 (quit) Fare: Quit: Leaving 00:51 offby1 <3 failure thunks, except replace <3 with a glyph that means "likes" 00:54 eli: rudybot: give offby1 ((compose string->symbol string integer->char) 9829) 00:54 rudybot: offby1: eli has given you a value, say "rudybot: eval (GRAB)" to get it (case sensitive) 00:56 chandler: eli: I can see two ways to deal with a short-circuiting `and' in a world where only booleans are true and false. One is to explicitly state that the last argument to `and' is not checked. Another is to make it not tail recursive; I think the situations where this matters would be much less common if it was only used on booleans because many test forms which are now written as (and a b c) would be rewritten as (if (and a b) c #f) . 00:57 offby1 clears throat 00:57 offby1: rudybot: (GRAB) 00:57 rudybot: *offby1: your scheme sandbox is ready 00:57 rudybot: *offby1: ; Value: ♥ 00:57 chandler: Heh. 00:57 eli: chandler: I consider tail-ness important enough to preserve, so I'd consider only the first option -- but that results in the confusing bit. 01:00 chandler: Let's see if my terminal's playing nice: ♥ 01:00 chandler: Sigh. 01:02 eli: It looks fine here. 01:02 offby1: ayup 01:03 chandler: Heh. That's because OS X pasted it in UTF-8, and it survived the path through SSH, screen, and irssi even though it displayed it back to me in ISO-8859-1. 01:05 (join) bem 01:05 (quit) chandler: Quit: leaving 01:06 (nick) bem -> chandler 01:06 chandler: OK, with a properly adjusted .login.conf: ♥ 01:06 chandler: Looks right to me; how about anyone else? 01:08 eli: Looks fine here. 01:09 chandler: Thanks. 04:00 (join) lucian 05:21 (join) hanDerPeder 05:22 (join) dzhus 05:31 (quit) hanDerPeder: Quit: hanDerPeder 05:34 (join) hanDerPeder 06:04 (join) lucian__ 06:05 (quit) lucian: Disconnected by services 06:05 (nick) lucian__ -> lucian 06:06 (join) lucian__ 06:12 (quit) lucian: Quit: Bye 06:20 (join) lucian 06:25 (quit) lucian: Client Quit 06:58 (join) b-man_ 07:00 (quit) b-man_: Remote host closed the connection 07:07 (join) martinhex 08:23 (join) MayDaniel 08:33 (join) malky42 08:35 (quit) MayDaniel: 08:38 malky42: hey guys, I'm using Racket on Windows. I typed in a short program: #lang web-server/insta (define (start request) `(html (head (title "Hello world!")) (body (p "Hello world!")))) I clicked run. Do you guys know what is the defaul url used by insta? I've tried localhost:8080 at the browser, but I can't get to my web page. 08:41 offby1: doesn't it display the URL when you click "run" ? 08:42 offby1: anyway, try "netstat -a", you should see the port in the output 08:48 (quit) martinhex: Remote host closed the connection 08:48 malky42: hey offby1, thank for your help -- I was wondering why that netstat command wasn't working for me. it turns out that i had to run the command "as administrator." Starting DrRacket "as administator" fixed the browser launch problem. thanks. 08:48 (quit) malky42: Quit: ERC Version 5.3 (IRC client for Emacs) 08:54 offby1: yikes 09:01 (join) sh10151 09:12 (quit) alexusraci: Quit: leaving 09:12 (join) alexsuraci 09:18 (quit) alexsuraci: Quit: leaving 09:18 (join) alexsuraci 09:35 bremner: and that is why you should never help people 09:38 offby1: certainly 09:52 (nick) lucian__ -> lucian 10:10 (quit) hanDerPeder: Remote host closed the connection 10:10 (join) hanDerPeder 10:22 (join) MayDaniel 10:39 (join) malky42 10:40 (join) sh10151_ 10:41 malky42: hey guys, do know if there are user defined keybindings for DrRacket that are like emacs keybindings. I see this option under Edit | Keybindings | Add user defined keybings from planet... but I've searched planet and I have not found any keybinding specs. Do you know if someone has already defined an emacs keybinding file? 10:43 (quit) sh10151: Ping timeout: 272 seconds 10:43 (nick) sh10151_ -> sh10151 10:46 offby1: dunno 10:48 chandler: malky42: You can get emacs keybindings in DrRacket by turning off the menu key bindings. 10:48 chandler: Hold on, let me find the option so I can describe it more exactly. 10:48 malky42: okay, i found out you should uncheck "enable keybindings in menus" under preference | Editing | General. Thank god. Everytime I was typing ctrl-p (for previous) that printing dialog 10:48 malky42: that's okay chandler 10:48 chandler: Yup, that's it. 10:48 malky42: i just found it. 10:54 (quit) malky42: Quit: ERC Version 5.3 (IRC client for Emacs) 10:54 (join) mceier 11:05 (join) Fare 11:07 Fare: Hi! 11:07 Fare: Is there an object persistence framework for racket? 11:09 chandler: There's Snooze, which is an object persistence layer on sqlite or postgresql. 11:10 chandler: Does rudybot do planet lookups? If not, that'd be a nifty thing to have. 11:10 Fare still hesitates between CL and racket for his next hack... 11:10 chandler: http://planet.racket-lang.org/display.ss?package=snooze.plt&owner=untyped 11:10 chandler: rudybot: help 11:10 rudybot: chandler: help [], version, quote, source, seen , uptime, t8 ..., init [], eval ..., give ..., apropos ..., desc , doc , later "tell" ... 11:13 chandler: Fare: Be a Racket man! 11:19 (join) sstrickl 11:35 (join) carleastlund 11:47 (join) asumu 11:57 (nick) tonyg_ -> tonyg 12:08 Demosthenes: so, what's the preferred "while" analog for scheme? 12:08 Demosthenes: or while/until ? 12:08 Demosthenes: revert to do? 12:17 (join) jonrafkind 12:19 samth_away: Demosthenes, (let loop () (if condition stop (loop))) 12:19 (nick) samth_away -> samth 12:20 samth: Demosthenes, also (for ([i (in-naturals)] #:when condition) ...) 12:20 Demosthenes: samth: yeah, i'm familiar with the recursion preference 12:20 Demosthenes: i'm just coming over from other languages and my first impulse was to look for while. ;] 12:22 samth: (define-syntax-rule (while condition body ...) (let L () (when condition body ... (L)))) 12:30 rapacity: how do I iterate over the keys/values of a hash using for: in typed/racket ? 12:35 samth: rapacity, right now it doesn't seem like any of the options will work 12:35 samth: i'll try to fix that 12:37 rapacity: oh, :p thanks 12:37 samth: rapacity, to iterate over a hashtable in TR, I'd use `hash-map' right now 12:44 jonrafkind: `in-hash' 12:44 jonrafkind: (define h (hash 'a 1 'b 2)) 12:44 jonrafkind: (for ([(key value) (in-hash h)]) 12:44 jonrafkind: (printf "~a ~a\n" key value)) 12:44 jonrafkind: oh typed/racket.. sorry 12:47 (quit) tv|z: Ping timeout: 245 seconds 12:49 (join) tv|z 12:52 samth: rapacity, it now works on my machine, should be committed soon 12:52 rapacity: yay :p thanks 12:55 (join) b-man_ 12:59 (quit) MayDaniel: Read error: Connection reset by peer 13:14 (join) anRch 13:16 (quit) sh10151: Remote host closed the connection 13:16 (join) sh10151 13:45 (join) MayDaniel 13:46 (quit) tonyg: Quit: leaving 13:52 (quit) anRch: Ping timeout: 250 seconds 13:53 Demosthenes: ok, any tips for stepping through code in emacs? 13:55 (join) dzhus89 13:56 Demosthenes: wow, a builtin logging library... 13:56 Demosthenes: cool 13:56 (quit) dzhus: Ping timeout: 250 seconds 13:59 (join) anRch 13:59 (quit) MayDaniel: 14:14 (quit) cinch: Ping timeout: 250 seconds 14:17 (join) philo 14:17 philo: hi 14:17 philo: is the for/list form the equivalent of haskell/ocaml map 14:20 jonrafkind: yea basically 14:20 jonrafkind: for/list is a little more general though 14:23 (join) cinch 14:23 (quit) cinch: Changing host 14:23 (join) cinch 14:28 philo: thanks but it is a form right 14:29 samth: philo, `map' is the equivalent of haskell's map 14:29 samth: `for/list' is more like a list comprehension 14:30 philo: ok thanks what i was looking for 14:30 philo: the difference is in the execution periode 14:30 philo: as in when the evaluation is done 14:32 jonrafkind: what do you mean 14:33 philo: i mean the list compression is done by the expander 14:34 jonrafkind: no, the for forms just expand into either an optimized loop or a generic sequence object 14:34 jonrafkind: but the code is run at run-time as usual 14:35 philo: so i understand correctly , after le expander is done, we get a list of unevaluated expression 14:36 jonrafkind: (syntax->datum (expand '(for ([i (in-list '(1 2 3 4))]) i))) 14:36 jonrafkind: type that in the repl 14:36 jonrafkind: or better yet, (syntax->datum (expand '(for ([i (in-list '(1 2 3 4))]) (+ i 1)))) 14:37 jonrafkind: you dont get back (list (+ 1 1) (+ 2 1) (+ 3 1) (+ 4 1)) which is what you seem to be suggesting 14:37 philo: ok i am so confused 14:37 jonrafkind: although I suppose it would be possible in some cases to do such a thing 14:38 philo: so how what is the difference wiith map ? 14:39 jonrafkind: right, its not. i have no idea what samth meant 14:39 (join) dzhus8989 14:40 philo: is there some kind of fundamentale diff between form and procedure 14:40 jonrafkind: i guess `form' usually means some syntactic construct and procedure is anything created by `lambda' 14:41 (quit) dzhus89: Ping timeout: 240 seconds 14:46 (quit) dzhus8989: Ping timeout: 245 seconds 14:49 samth: jonrafkind, what i meant was exactly what i said 14:49 samth: and was correct 14:49 samth: `for/list' is a syntactic form describing the creation of lists drawing from some data 14:49 samth: it's exactly like a list comprehension 14:50 jonrafkind: how is map not a list comprehension 14:50 samth: `map' is a procedure -- it's just like haskell's map 14:50 jonrafkind: this seems like being pedantic with words 14:50 samth: no, it's using words correctly 14:50 jonrafkind: a list comprehension is necessarily a syntactic form? 14:50 samth: http://en.wikipedia.org/wiki/List_comprehension 14:50 samth: yes 14:51 jonrafkind: ok, so the only real difference is `for/list' is not a first-class value whereas map is 14:53 samth: no, really, `for/list' corresponds precisely to list comprehensions in python/haskell/math/etc 14:53 samth: whereas map does not 14:54 samth: for example, this from the wikipedia page: s = [ 2*x | x <- [0..], x^2 > 3 ] 14:54 samth: is (for/list ([x (in-naturals) #:when (> (sqr x) 3)]) (* 2 x)) 14:57 (quit) anRch: Quit: anRch 14:59 Demosthenes: does anyone have an example of using logging? the manual briefly discusses it, but i can't find any code samples 15:06 (join) masm 15:31 samth: Demosthenes, see https://github.com/plt/racket/blob/master/collects/typed-scheme/utils/tc-utils.rkt and look for `warn-unreachable' 15:31 rudybot: ?? 15:31 carleastlund: rudybot: !! 15:31 rudybot: carleastlund: eh? Try "rudybot: help". 15:39 clklein: samth: Can you explain why this TR program doesn't typecheck? 15:39 lisppaste: clklein pasted "TR puzzle" at http://paste.lisp.org/display/117433 15:40 jonrafkind: clklein, cadr? 15:41 clklein: jonrafkind: Hrm? 15:41 jonrafkind: oh sorry, its just a cons pair 15:43 carleastlund: clklein, You have a polymorphic function applied to polymorphic arguments. TR is almost never smart enough to do that on its own. You'll have to explicitly instantiate >< at the appropriate types. 15:46 clklein: k 15:46 (quit) sh10151: Quit: sh10151 15:56 samth: clklein, carleastlund is correct, but you can also instantiate id (which might be more convenient) 16:16 clklein: samth: Actually, I don't think I can instantiate either. I would be instantiating them with type variables, and the ones introduced by the All outside the definition are not in scope. 16:16 clklein: (the actual example is more complicated than what I pasted) 16:16 samth: i don't see how it can be possible not to be able to instantiate them 16:17 clklein: OK, I'll make an example. 16:20 Demosthenes: samth: thanks 16:20 clklein: Uh, that's weird. I didn't get a "Unbound type name" error in my simplified example. 16:20 clklein: I'll get back to you :) 16:22 Demosthenes: samth: so if you want to turn on loggin for 'info? 16:23 samth: that's controlled with the -W command line argument to racket 16:26 Demosthenes: only for the default logger? and how can you change that on the fly? or make our own? 16:38 lisppaste: clklein pasted "unbound type variables" at http://paste.lisp.org/display/117436 16:40 clklein: samth: I was doing something like `doesnt-work' and `curried-><' when I thought the All-bound variables wouldn't be in scope 16:40 clklein: I still don't know why they're not, but I know how to get around it now 16:57 (quit) mceier: Quit: leaving 17:12 Demosthenes: *ponder* i'm really surprised i have to learn about async events just to use logging... 17:15 (quit) b-man_: Remote host closed the connection 17:18 samth: Demosthenes, you really shouldn't need to 17:23 samth: clklein, so is your current status happy? 17:30 Demosthenes: samth: i think the issue is i'm running a repl in geiser troubleshooting, and i really can't adjust the CLI parameters. i'd rather just adjust the current loglevel to 'info and use log-info for a bit... 17:31 samth: there's an environment variable 17:31 Demosthenes: samth: but all the examples i've found grepping thru the racket source and googling against the main site turn up having to write a custom async handler and binding it to 'info 17:31 Demosthenes: which is frustrating given i'd expect i could query the current logger and loglevel, and simply update the loglevel. 17:32 Demosthenes: i've dropped to the cli for now 17:41 samth: Demosthenes, i'd raise that as an issue on the mailing list (provided that the env variable doesn't dynamically change the behavior) 17:42 sstrickl: jonrafkind: isn't it still an issue if you drop the -l? "raco setup foo bar -D" fails with the same error, doesn't it? 17:42 sstrickl: at least I swear I ran into this earlier today 17:42 jonrafkind: yes but now it matches the grammar 17:42 jonrafkind: ... 17:42 sstrickl: ah, gotcha 17:42 jonrafkind: but it would be nice to give -D last, ohw el 17:55 (quit) asumu: Ping timeout: 245 seconds 18:02 (quit) masm: Quit: Leaving. 18:08 (join) masm 18:12 (quit) masm: Client Quit 18:17 (join) masm 18:35 (join) asumu 18:45 (quit) cinch: Changing host 18:45 (join) cinch 18:50 (quit) sstrickl: Quit: sstrickl 18:55 (quit) hanDerPeder: Quit: hanDerPeder 18:55 clklein: samth: Yes, though I am a little curious why the type variables are not bound. No big deal, though. 18:59 (join) hanDerPeder 19:10 samth: clklein, it's only `lambda' that puts the type variables in scope 19:10 samth: but probably that should be changed 19:26 clklein: got it 19:35 (quit) asumu: Ping timeout: 240 seconds 19:42 Lajla: clklein, tell me about your extended BNF 19:43 clklein: Lajla: what do you mean? 19:44 Lajla: clklein, well, if you were a context free language. 19:44 Lajla: I bet you would be defined by expression := "clklein" 19:44 clklein: could be 19:44 clklein: but I think I'm probaly not context-free 19:45 Lajla: clklein, but it makes parsing you so much easier. 19:49 clklein: I don't like being parsed -- too violating 19:52 Lajla: clklein, but how would I compile a program written in you to machine language then? =( 20:05 (join) b-man_ 20:30 (quit) jonrafkind: Ping timeout: 245 seconds 20:50 Demosthenes: hrm, is there something similar to CL's "inspect" for Scheme? 20:53 eli: Demosthenes: Not really, but look for `describe' on planet. 20:56 Demosthenes: eli: thanks, looking 20:57 Demosthenes: hrm, thats not helping :P (at least in my case ;]) 20:58 samth: Demosthenes, what is your case? 21:00 Demosthenes: i was just trying to get more information from the default system logger 21:00 Demosthenes: but (current-logger) just returns #, and no detail 21:00 Demosthenes: i'm used to using inspect to view internals ;] 21:01 Demosthenes: describe didn't help 21:01 Demosthenes: sad, log4scm has no docs and the website no longer exists 21:01 samth: well, you can use `log-level?' to query the current logger 21:01 Demosthenes: only to get back a t/f value as to whether a loglevel is enabled for logging 21:02 samth: right 21:02 Demosthenes: it doesn't appear to tell me what event handler is subscribed 21:02 Demosthenes: it looks like to enable 'info on the fly, would just require reusing the default event handler to stderr 21:02 Demosthenes: and attaching it to the current logger with the 'info priority 21:02 Demosthenes: but the calls don't return that information, just t/f 21:03 samth: what other information could it return? 21:03 Demosthenes: i'm not sure how the events work, but i was thinking maybe that function ;] 21:04 eli: Demosthenes: See my interactive hack -- it has a ,log command to turn on logging from the repl. 21:04 (quit) parcs: Ping timeout: 240 seconds 21:04 Demosthenes: oo! link/ 21:05 eli: http://barzilay.org/hacks.html (IIRC) 21:05 eli: (I did RC...) 21:06 (join) parcs 21:08 (nick) samth -> samth_away 21:14 (quit) hanDerPeder: Quit: hanDerPeder 21:15 (join) asumu 21:17 (join) shofetim 21:38 (quit) b-man_: Remote host closed the connection 21:39 (join) b-man_ 21:50 (quit) lucian: Remote host closed the connection 21:55 Fare: eli: hi! 21:55 (join) Gwyth 21:56 eli: Good morening. 21:56 eli: s/e// 21:56 Gwyth: s/morning/evening/ 22:06 askhader: win 20 22:16 (quit) carleastlund: Quit: carleastlund 22:45 (quit) b-man_: Remote host closed the connection 23:48 (quit) masm: Quit: Leaving.