Re: [racket] world/universe update model (functional update redux), using the I/O monad for state

2011-12-12 Thread Matthias Felleisen
Is the below really much less natural to write? I really enjoyed playing the qwerty row from left to right, or perhaps I was pressing the number keys at the same time :-) #lang racket (require (except-in (planet clements/rsound) overlay scale) 2

Re: [racket] web server log format

2011-12-12 Thread Jordan Schatz
On Mon, Dec 12, 2011 at 04:38:06PM -0500, Eli Barzilay wrote: > The common reason to not include it is when the response comes from > code, and you can't include the size before you've run the code which > means that you have to hold the complete response somewhere before you > send it. Thanks Eli

[racket] Anyone have experience or opinions on using RESTful Racket back end with a rich client library like GWT?

2011-12-12 Thread Grant Rettke
Hi, I'm in the middle of a GWT system implementation and wondering how it would look a restful backend had been used. Racket seems like it could have a nice place there. Best wishes, Grant -- http://www.wisdomandwonder.com/ ACM, AMA, COG, IEEE _

Re: [racket] More than one color with draw-text?

2011-12-12 Thread Stephen Bloch
On Dec 12, 2011, at 6:02 PM, Robby Findler wrote: > Creating images for each character you plan to display will probably > have two disadvantages: it will use more memory, and it will void the > work that the OS does to make letters fit together (ligatures and > sometimes kerning). But in a Rogu

Re: [racket] In rkt or scheme, is there way to refer to the value of last expression?

2011-12-12 Thread J G Cho
Thanks for all the good answers as usual. BTW, rkt is very "practical" in the sense it makes me think about programming in a way that I normally do not in my more mundane chores. On Tue, Dec 13, 2011 at 9:29 AM, Richard Cleis wrote: > I was thinking that a person mailing from 'fundingmatters' is

Re: [racket] In rkt or scheme, is there way to refer to the value of last expression?

2011-12-12 Thread Richard Cleis
I was thinking that a person mailing from 'fundingmatters' is asking a more practical question, for which 'compose' is the answer :O) #lang racket/base (define some-list '(1 2 3)) (define proc-1 +) (define proc-2 sqrt) (define (proc-n v) (* v 10)) (define f (compose proc-n proc-2 proc-1)) (app

Re: [racket] In rkt or scheme, is there way to refer to the value of last expression?

2011-12-12 Thread Robby Findler
On Mon, Dec 12, 2011 at 6:08 PM, Danny Yoo wrote: > ;; Exercise: > (begin/it >  (+ 1 2) >  (f it)  ;; ... Um, didn't mean to swear there. >  (g it)) Good thing, because you _didn't_ swear. Danny's examples are excellent and he's even gone so far as to implement an entire language with a very coo

Re: [racket] In rkt or scheme, is there way to refer to the value of last expression?

2011-12-12 Thread Danny Yoo
> Just for the readability, is it possible to write > > some-list > (proc-1 some-list) > (proc-2 (val-of-last-expression)) > ... > (proc-n (val-of-last-expression)) ;where n is 'largeish' > > instead of > > (proc-n ... (proc-2 (proc-1 some-list Possible. The syntax in Racket is progr

Re: [racket] In rkt or scheme, is there way to refer to the value of last expression?

2011-12-12 Thread Neil Van Dyke
Also, consider a "let*" form. You can even use the same variable name for each binding, if you like. Neil Van Dyke wrote at 12/12/2011 07:02 PM: J G Cho wrote at 12/12/2011 06:49 PM: Just for the readability, is it possible to write some-list (proc-1 some-list) (proc-2 (val-of-last-expressio

Re: [racket] In rkt or scheme, is there way to refer to the value of last expression?

2011-12-12 Thread Neil Van Dyke
J G Cho wrote at 12/12/2011 06:49 PM: Just for the readability, is it possible to write some-list (proc-1 some-list) (proc-2 (val-of-last-expression)) ... (proc-n (val-of-last-expression)) ;where n is 'largeish' If you are interacting in XRepl, you can do this: http://docs.racket-lang.org

[racket] In rkt or scheme, is there way to refer to the value of last expression?

2011-12-12 Thread J G Cho
Just for the readability, is it possible to write some-list (proc-1 some-list) (proc-2 (val-of-last-expression)) ... (proc-n (val-of-last-expression)) ;where n is 'largeish' instead of (proc-n ... (proc-2 (proc-1 some-list Just curious, jGc _

Re: [racket] world/universe update model (functional update redux), using the I/O monad for state

2011-12-12 Thread Matthias Felleisen
On Dec 12, 2011, at 5:36 PM, Stephen Bloch wrote: > I would very much like to see SOME kind of functional-update feature bundled > -- whether it comes along with define-struct, or with big-bang, doesn't > matter much to me. We are working on it in a rather different context. __

Re: [racket] More than one color with draw-text?

2011-12-12 Thread Robby Findler
Creating images for each character you plan to display will probably have two disadvantages: it will use more memory, and it will void the work that the OS does to make letters fit together (ligatures and sometimes kerning). (Probably using picts is the right way to go.) Robby On Mon, Dec 12, 20

Re: [racket] More than one color with draw-text?

2011-12-12 Thread Jay McCarthy
Take a look at https://github.com/jeapostrophe/rl particularly https://github.com/jeapostrophe/rl/blob/master/ui/ui-world.ss Jay On Mon, Dec 12, 2011 at 8:53 AM, Will Robinson wrote: > Hello, > > I'm trying to do a simple Roguelike game as an exercise in learning the > language, particularly

Re: [racket] web server log format

2011-12-12 Thread Jay McCarthy
On Mon, Dec 12, 2011 at 2:32 PM, Jordan Schatz wrote: > On Mon, Dec 12, 2011 at 11:30:59AM -0700, Jay McCarthy wrote: > > But the Racket Web server only has request logging by default, not > response > > logging, so it makes something up in these positions. I will update the > > docs to mention t

Re: [racket] More than one color with draw-text?

2011-12-12 Thread Will Robinson
Thanks everyone for the suggestions. Stephen, to answer your question, I want to be able to change the text independently. The letter d, for example, I might want to show sometimes in white, red, or green. I guess I could make a pic for each though. On Mon, Dec 12, 2011 at 4:31 PM, Stephen Bloc

Re: [racket] web server log format

2011-12-12 Thread Neil Van Dyke
Eli Barzilay wrote at 12/12/2011 04:38 PM: ...also, in what Jordan posted there was a Content-Length: 2629 header, so the information is already there. I think that this part of the format typically represents how much was *actually* transmitted, not how much was *supposed* to be tran

Re: [racket] Text% efficiently iterating over items

2011-12-12 Thread Robby Findler
Oh: what about turning the editor into a port and then using regexp-matching on it? The position of the port will be a delta from where you created the position of the editor. Eg: #lang racket/gui (define t (new text%)) (void (send t load-file (collection-file-path "private/rep.rkt" "drracket")))

Re: [racket] Text% efficiently iterating over items

2011-12-12 Thread Erich Rast
Yes, sorry, I've meant string-snip%. Okay, I'll iterate over snips then, because I need to match whole character sets. Thanks! Best, Erich On Mon, 12 Dec 2011 16:12:13 -0600 Robby Findler wrote: > You might get away with just using the find-string method of text%, > but if not, then you do

Re: [racket] world/universe update model (functional update redux), using the I/O monad for state

2011-12-12 Thread Stephen Bloch
On Dec 12, 2011, at 2:52 PM, John Clements wrote: > Here's a world/universe program written by one team in my class. It uses > mutation all over the place:... > Standard functional update observation: > > This is definitely the natural way to write the program: certain keypresses > correspond

Re: [racket] More than one color with draw-text?

2011-12-12 Thread Stephen Bloch
On Dec 12, 2011, at 10:53 AM, Will Robinson wrote: > Hello, > > I'm trying to do a simple Roguelike game as an exercise in learning the > language, particularly racket/gui. I'm using draw-text to place characters > on the screen. Ideally, I'd just call this once and put up huge string full

Re: [racket] Text% efficiently iterating over items

2011-12-12 Thread Robby Findler
You might get away with just using the find-string method of text%, but if not, then you do have to iterate snip by snip. The positions inside string-snip%s are offsets from the position of the whole snip for characters (is that what you're asking for when you say text-snip%?). Robby On Mon, Dec

[racket] Text% efficiently iterating over items

2011-12-12 Thread Erich Rast
Is there a fast way to iterate over items or words in a text% instance starting from some position. For example, I'd like to go forward or backward starting from a position until a character in a given srfi14 char-set is found. Using a string returned get-text doesn't seem to work in general beca

Re: [racket] web server log format

2011-12-12 Thread Eli Barzilay
Three hours ago, Jay McCarthy wrote: > Alright. I looked into this more. > > The 200 and 512 from the log are not about the request, they are about the > response: > > "200 (%>s) [...]" But the original problem was about the response size... > But the Racket Web server only has request logging

Re: [racket] web server log format

2011-12-12 Thread Jordan Schatz
On Mon, Dec 12, 2011 at 11:30:59AM -0700, Jay McCarthy wrote: > But the Racket Web server only has request logging by default, not response > logging, so it makes something up in these positions. I will update the > docs to mention this. I think that a single dash is typically used if a value is m

Re: [racket] Racket Web Server

2011-12-12 Thread jordan
On Sun, Dec 11, 2011 at 10:38:02PM -0600, Gerry Weaver wrote: > However, if you could rough out an outline of the things your trying to > capture, I would be happy to help where I can. A list of the top ten or twenty issues you encountered while getting racket/scheme to work for you, and optionall

Re: [racket] Racket Web Server

2011-12-12 Thread Jordan Schatz
https://github.com/shofetim/Racket-Riak Its very much still a work-in-progress. You can store, update, retrieve, get server status, get/set bucket properties, and map reduce. I need to update it for some changes in riak 1.0, add support for Luwak, and handle multipart responses. I also want to loo

[racket] world/universe update model (functional update redux), using the I/O monad for state

2011-12-12 Thread John Clements
The holiday season: time to grade lots of projects, and "goof off" by thinking about how those programs could better be expressed. Here's a world/universe program written by one team in my class. It uses mutation all over the place: #lang racket (require (except-in (planet clements/rsound)

Re: [racket] web server log format

2011-12-12 Thread Jay McCarthy
Alright. I looked into this more. The 200 and 512 from the log are not about the request, they are about the response: "200 (%>s) This is the status code that the server sends back to the client. This information is very valuable, because it reveals whether the request resulted in a successful re

Re: [racket] More than one color with draw-text?

2011-12-12 Thread Neil Toronto
On 12/12/2011 08:53 AM, Will Robinson wrote: Hello, I'm trying to do a simple Roguelike game as an exercise in learning the language, particularly racket/gui. I'm using draw-text to place characters on the screen. Ideally, I'd just call this once and put up huge string full of newlines to repr

[racket] More than one color with draw-text?

2011-12-12 Thread Will Robinson
Hello, I'm trying to do a simple Roguelike game as an exercise in learning the language, particularly racket/gui. I'm using draw-text to place characters on the screen. Ideally, I'd just call this once and put up huge string full of newlines to represent a block of text. My problem is that I wa

Re: [racket] Racket Web Server

2011-12-12 Thread nicolas.o...@gmail.com
> > PS You also mentioned sedna. I'm guessing you might also be frustrated > with relation databases? I am also tired of writing ORMs and am using the > move to Racket as a good chance to move to different ways of storing > data, I've found that Riak http://wiki.basho.com/ works well, and its the >

Re: [racket] Racket Web Server

2011-12-12 Thread Jay McCarthy
Another good thing to read about continuations is the continuation chapter of http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/ Here's my short take on "why" continuations for the Web: * Due to HTTP's stateless nature, Web clients must "remind" Web servers of what the server was doing fo

Re: [racket] Racket Web Server

2011-12-12 Thread Gerry Weaver
Hi Neil, Thanks for the link. It was VERY helpful. It does answer the "why" part of the question, but not necessarily the "if" part. I'm thinking in terms of a real world application and it's maintainability. It seems while a particular problem was solved, the bar on the price of entry to the c

[racket] Scribble appendix

2011-12-12 Thread David Van Horn
Is there a Scribble analog of \appendix? David _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] Racket Web Server

2011-12-12 Thread Neil Van Dyke
Gerry Weaver wrote at 12/12/2011 02:29 AM: What exactly are the benefits of a continuation based design? Does this paper address your questions? Krishnamurthi, Hopkins, McCarthy, Graunke, Pettyjohn, Felleisen, "Implementation and Use of the PLT Scheme Web Server", Journal of Higher-Order and S