00:07 (quit) hanDerPeder: Quit: hanDerPeder 00:23 (join) jon5 00:25 (nick) jon5 -> jonrafkind 00:25 (quit) jonrafkind: Client Quit 00:25 (join) jonrafkind 00:56 (join) Naith 00:59 (quit) Naith: Client Quit 01:52 (join) Naith 02:27 (quit) jonrafkind: Ping timeout: 272 seconds 05:40 (join) masm 05:50 (join) arcfide 05:50 (part) arcfide 05:59 (join) MayDaniel 07:27 (quit) Naith: Quit: Naith 07:42 (part) MarcWeber 08:07 (quit) TheRealPygo: Ping timeout: 265 seconds 08:09 (join) pygospa 08:36 (join) hanDerPeder 08:37 (quit) hanDerPeder: Client Quit 09:08 (join) jeapostrophe_ 09:14 (join) hanDerPeder 09:15 (quit) hanDerPeder: Client Quit 09:19 (quit) jeapostrophe_: Quit: jeapostrophe_ 09:19 (join) jeapostrophe_ 09:23 (quit) martinhex: Remote host closed the connection 09:33 (join) mceier 09:51 (quit) MayDaniel: 10:09 (join) hanDerPeder 10:36 (join) danbrown 10:46 (quit) hanDerPeder: Quit: hanDerPeder 10:55 (join) b-man_ 11:13 (join) MayDaniel 11:18 (quit) b-man_: Remote host closed the connection 11:38 (join) anRch 11:48 (join) hanDerPeder 11:52 (quit) jeapostrophe_: Quit: jeapostrophe_ 12:07 (quit) mikeX: Ping timeout: 255 seconds 12:09 (join) mikeX 12:10 offby1: "We've thrown out about 200,000 lines of C++ code that built 12:10 offby1: on Xt, Win32, and Carbon. We've replaced it with about 30,000 lines of Racket code that builds on Gtk, Win32, Cocoa, Cairo, and Pango." 12:10 offby1: very cool 12:14 (join) emma_ 12:15 (quit) emma: Read error: Connection reset by peer 12:24 (nick) emma_ -> emma 12:54 (quit) anRch: Quit: anRch 13:24 (join) Texx 13:25 (part) Texx 13:29 (join) cscheid 13:34 cscheid: Hey guys, I'm sure this is an idiotic question, but I'm having some trouble convincing Racket that one of my procedure calls respects the required contract, and I'm not quite sure how to solve it 13:35 cscheid: I only experience the problem when running the code with serve/servlet, so I have a hunch that some interaction with dynamic loading might be to blame here 13:36 cscheid: Specifically, there's a part? (from scribble/core) procedure which returns true when I run things from the interactive racket prompt, but returns false when I run the same code via a procedure passed to serve/servlet 13:37 cscheid: I end up getting a servlet error claiming "broke the contract (-> part? (or/c #f content?)) on part-title-content; expected , given: #" 13:59 (join) jeapostrophe_ 13:59 (quit) jeapostrophe_: Client Quit 14:02 offby1: doesn't sound idiotic; it sounds subtle 14:02 offby1: is your code simple enough that you can paste it somewhere, and let us try to repro it? 14:09 cscheid: It's not terribly complicated, but I can try to simplify it some more. Let me work on it for a bit. 14:15 offby1: and when I say "us", I mean "me" 14:16 cscheid: :) Thanks a lot, I appreciate the help. I think I can't make it smaller than two files, but they should be no bigger than ~50 lines each 14:17 offby1: probably OK. 14:24 cscheid: ok - http://dl.dropbox.com/u/2785146/repro.tar.gz 14:24 cscheid: untar that anywhere, then trigger it like this 14:25 cscheid: cd repro; racket 14:25 cscheid: $ racket Welcome to Racket v5.0.1. > (require "posts.rkt") > (define posts (load-posts "posts")) > (part->xexpr (first posts)) '(div (div ((class "part-title")) (h1 "This is a new title")) (p "There would be some blocks here")) > 14:25 cscheid: (this is when it works) 14:26 cscheid: however, if you instead say $ racket serve.rkt 14:26 cscheid: you'll get the exception and stack trace 14:28 cscheid: In case it is of any use, I get this on a user-level install of Racket v5.0.1 (that is, racket lives inside /home/cscheid/...), from source, on x86_64 Ubuntu 10.04, which I downloaded from racket-lang.org maybe a month ago 14:38 cscheid: I just posted this to the mailing list too. Thanks for prodding me into making a reproducible case :) 14:43 (join) evhan 14:45 cscheid: (I gotta run, be back in 30-45min) 14:54 (join) jeapostrophe_ 15:01 (quit) jeapostrophe_: Quit: jeapostrophe_ 15:09 offby1: cscheid: other than 'cannot open input file: "/tmp/repro/./conf/not-found.html"', I get no errors via "racket serve.rkt" 15:09 offby1: This is "v5.0.1.900", which I guess I built from source 15:09 offby1: Ubuntu 10.10 15:10 offby1: it opens my browser and shows me a web page that says "This is a new title / There would be some blocks here", which I assume means it's working 15:10 offby1: so: I can't repro your problem :-( 15:13 offby1: maybe you have some content in your posts that I don't, that's triggering the problem? 15:22 (join) Naith 15:39 cscheid: Hey, I'm back. 15:39 cscheid: This is exactly the content that triggers the issue. 15:41 cscheid: Hm - Jay McCarthy on the mailing list told me I should use the #:make-servlet-namespace and #:servlet-namespace keyword args 15:43 cscheid: Which makes perfect sense in hindsight, but I guess doesn't explain the discrepancy between your output and mine. You're using v5.0.1.900, and I'm using v5.0.1. Perhaps that's it 15:48 offby1: I wonder if you've found a racket bug 15:49 cscheid: unlikely 15:50 offby1: can't say I understood Jay's response, but as long as _you_ understand it, all is well :) 15:50 cscheid: at least in my experience :) 15:51 cscheid: I'm not sure I understood it either, really 15:52 cscheid: because the module is only being requested at one place in serve.rkt. That could make sense if the server somehow sent data across servlet boundaries 15:57 cscheid: However, the code _does_ work when I add the keyword arg #:servlet-namespace (list "posts.rkt") 16:05 eli: It's not that difficult. 16:05 eli: rudybot: (define a (delay (+ 1 2))) 16:05 rudybot: eli: your sandbox is ready 16:05 rudybot: eli: Done. 16:05 eli: rudybot: give offby1 a 16:05 rudybot: offby1: eli has given you a value, say "rudybot: eval (GRAB)" to get it (case sensitive) 16:05 eli: offby1: Try to force that. 16:07 eli: rudybot: give cscheid a 16:07 rudybot: cscheid: eli has given you a value, say "rudybot: eval (GRAB)" 16:07 eli: cscheid: In case you want to try it. 16:08 cscheid: rudybot: eval (GRAB) 16:08 rudybot: cscheid: your sandbox is ready 16:08 rudybot: cscheid: ; Value: # 16:08 cscheid: rudybot: eval (force a) 16:08 rudybot: cscheid: error: reference to undefined identifier: a 16:08 cscheid: I guess I lose at this game :) 16:09 eli: cscheid: try (force (GRAB)) 16:09 cscheid: ah, right 16:09 cscheid: rudybot: eval (force (GRAB)) 16:09 rudybot: cscheid: ; Value: # 16:09 eli: cscheid: now try (promise? (GRAB)) 16:09 cscheid: rudybot: eval (promise? (GRAB)) 16:09 rudybot: cscheid: ; Value: #f 16:10 cscheid: fun 16:10 cscheid: but I guess my point is that in this case you generated the data in your namespace (or whatever it is the right name for this) 16:10 eli: cscheid: `struct' in racket (formerly known as `define-struct') is a *generative* tool for creating new structs. 16:11 eli: Since we have separate sandboxes on rudybot, each sandbox has its own idea of what is a promise. 16:12 cscheid: while it seemed to me that in the case inside that repro.tar.gz, the same namespace (sandbox?) which called load-posts used part-title-content 16:15 (quit) evhan: Ping timeout: 255 seconds 16:16 eli: cscheid: That I don't know much about -- it depends on how the web server runs code -- and it certainly does create a new namespace, hence Jay's answer. 16:16 eli: (And I think that it's something that has changed in some way in 5.0.2) 16:26 cscheid: eli and offby1: alright, then; thanks for the help! 16:37 offby1: rudybot: eval (force (GRAB)) 16:37 rudybot: *offby1: your scheme sandbox is ready 16:37 rudybot: *offby1: ; Value: # 16:37 offby1: promises, promises 16:39 eli: offby1: The point is that it doesn't force it, since for you, it's not a promise... 16:39 offby1: huh 16:39 offby1: rudybot: eval (promise? (GRAB)) 16:39 rudybot: *offby1: ; Value: #f 16:39 offby1 strokes beard thoughtfully 16:40 eli: That's the point of having a module instantiated or not... Since rudybot's sandboxes don't share anything, all code is instantiated from scratch there, 16:40 eli: so all structs are disjoint from structs in other sandboxes. 16:46 (quit) MayDaniel: 16:49 (quit) cscheid: 17:01 (quit) hanDerPeder: Quit: hanDerPeder 17:40 offby1: now, that makes sense. 17:40 offby1: But I didn't know promises were structs. 18:00 (join) MayDaniel 18:08 His_Shadow: rudybot: eval ("What do you do when you are asked to call a string with no arguments?") 18:08 rudybot: His_Shadow: your sandbox is ready 18:08 rudybot: His_Shadow: error: procedure application: expected procedure, given: "What do you do when you are asked to call a string with no arguments?" (no arguments) 18:12 offby1: rudybot: what do you call a procedure with no arguments? 18:12 rudybot: *offby1: the formal parameters of a procedure are bound within the body of an expression yes 18:14 (join) jonrafkind 18:22 (quit) Naith: Quit: Naith 18:24 (quit) emma: Remote host closed the connection 18:42 His_Shadow: offby1, insightfull albeit nonsensical response. 18:42 His_Shadow: I like this idea though ("string" :ref 3) instead of (string-ref "string" 3) 18:43 jonrafkind: "string.3 18:44 (join) Axsuul 18:44 (join) Naith 18:50 (join) jeapostrophe_ 18:50 His_Shadow: jonrafkind, yes, that is the idea. 18:51 His_Shadow: But we all know that message pasing is faaaar more elitist than method calling 18:51 His_Shadow: And we all know that being elitist is faaaaar more elitist than not being elitist. 18:51 jonrafkind: "string".3 can be a message, just like in ruby 18:51 His_Shadow: That is true. 18:52 His_Shadow: But I don't know, unifying function cals and message sends through the same interface has its charms. 18:52 His_Shadow: Kind of like French people who talk about aeternal love. 18:53 jonrafkind: the only thing i know about french culture is what I read in the 'tropic of cancer' 18:54 (quit) jeapostrophe_: Client Quit 18:54 His_Shadow: Oh wow, you can even string substitute in ruby by string = "jonrafkind"; string['raf'] = 'turbo'; 18:54 His_Shadow: Now string holds 'jonturbokind' 18:54 His_Shadow: That's a bit too much 18:54 jonrafkind: yea 18:55 jonrafkind: well you could imagine a similar immutable function in racket, (substitute "blah" 2 2 "foo") => "bfooh" 18:56 His_Shadow: Yeah, sure. 18:56 His_Shadow: But I think it's cute that you can 'index' strings like that. 18:56 His_Shadow: THough it's kind of 'adding feature above feature' 18:57 jonrafkind: its nice to have convienences 19:09 His_Shadow: jonrafkind, calvinism f0 lyyfe. 19:09 His_Shadow: Thou shalt work 19:23 (join) b-man_ 19:26 (quit) MayDaniel: 19:35 (join) emma 19:36 (quit) emma: Client Quit 19:37 (join) emma 19:41 (quit) mikeX: Ping timeout: 276 seconds 19:41 (quit) Naith: Quit: Naith 19:42 (quit) emma: Read error: Connection reset by peer 19:42 (join) mikeX 19:43 (join) emma 19:50 offby1: His_Shadow: Paul Graham's "arc" language, if I recall correctly, does something like ("string" :ref 3) -- maybe just ("string" 3) 19:51 offby1: sequences are really functions on indices, I think it is. 19:51 His_Shadow: offby1, that was my original idea yes. 19:51 His_Shadow: But I changed it to this, because I can now also ("string" :slice 2 5) et cetera 19:51 His_Shadow: ("string" :len) 19:52 His_Shadow: Clojure by the way treats vectors and strings et cetera as functions of naturals to their contents 19:53 His_Shadow: In Clojure I think (random-set bla) also returns bla if bla is a member of that set, end nil otherwise. 19:53 His_Shadow: Not sure if sets can contain nil. 19:59 offby1 keeps meaning to play more with Clojure, but never gets around to it 20:01 His_Shadow: offby1, to be honest, while clojure seemed great at the start, the more I learn about it, the less I like it. 20:01 His_Shadow: A lot of things about it are devoid of aeternal logic. Like (set 1 2 3 4) is a set of those four numbers, makes sense, right? 20:02 His_Shadow: But (set "abcd" "efg" "bla") is a set of all the characters in those strings, not a set of those strings. 20:02 His_Shadow: internal logic* 20:03 offby1: that is indeed surprising 20:03 His_Shadow: offby1, well, it follows 'the principle of least surprise'. 20:03 offby1: presumably there's _some_ way to make a set of those three strings. 20:03 His_Shadow: But I find that that principle surprises a lot. 20:03 His_Shadow: Well, I suppose that #{"string" "other-string"} wouldwork. 20:04 His_Shadow: What I do like though, [a b c d] is a vector of four symbols. 20:04 His_Shadow: But like, a vector that is evaluated evaluates to a vector which contains the sequential evaluations of the old vector. 20:05 His_Shadow: So typing [(+ 1 2) (+ 3 5)] in code, which is a vector of two lists in data, becomes [3 8] 20:11 offby1: *eeeeerppp 20:11 offby1: wait. 20:11 offby1: in [a b c d], the symbols aren't evaluated as variable names ... 20:11 offby1: but in [(+ 1 2) (+ 3 5)], the + _is_ evaluated as a variable naming a procedure?! 20:12 offby1: where's the logic in that? 20:12 His_Shadow: offby1, they are. 20:12 His_Shadow: [a b c d] is a vector of four symbols, but it is evaluated to for instance [1 2 3 4] 20:13 offby1: so if i define a as 1, b as 2, etc; _then_ [a b c d] evaluates to 1 2 3 4. 20:13 His_Shadow: Like (let [a 0 b 1 c 2 d 4] [a b c d]) evaluates to [0 1 2 3] 20:13 offby1: fair enough. 20:13 His_Shadow: But I would not be surprised by clojure if they broke that rule. 20:13 offby1: oh, I thought [a b c d] => [a b c d]. 20:13 His_Shadow: To be honest, I; m not even sure if (set "abc "efg") displays the behaviour I described above. 20:13 His_Shadow: It could be that it again does that once you make a set of multiple sequences 20:20 offby1: clojure is so hard to install that I don't even want to bother in order to find out 20:21 His_Shadow: But it runs on the JVM! 20:21 His_Shadow: Easy to use. 20:21 His_Shadow: And it interfaces with Java! 20:22 His_Shadow: You just don't have TCO. 20:22 His_Shadow: offby1, if I were to call you as the last think I would do before I die, you would take my place and not take up an additional stack frame, would you? 20:48 (quit) mceier: Quit: leaving 20:52 (quit) b-man_: Remote host closed the connection 21:17 (join) Naith 21:29 (quit) lisppaste: Ping timeout: 255 seconds 21:47 (quit) masm: Quit: Leaving. 21:56 (quit) Naith: Quit: Naith 22:03 (quit) jonrafkind: Ping timeout: 260 seconds 22:22 offby1 fidgets uncomfortably 22:22 offby1: that's an awful big responsibility 22:22 offby1: you could just pass your continuation on to me; I'd promise to use it faithfully 22:41 (quit) danbrown: Remote host closed the connection 22:55 His_Shadow: offby1, we don't use a call stack model? =( 22:55 His_Shadow: The Java programmers would hate us. 22:55 His_Shadow: offby1, racket doesn't use CPS, right? 23:24 offby1: I have no idea 23:50 (quit) mikeX: Ping timeout: 240 seconds 23:52 (join) mikeX 23:57 (join) danbrown