[racket] another mini-tutorial: a racket slice: munging IRC logs

2011-08-05 Thread Danny Yoo
I'm thinking of writing a series called "Racket Slices", which does a cookbook-style approach to learning about Racket. I think there's a need for documentation that takes a "slice", a cross section of Racket to do some simple (but real-world!) task. And since we're using the name "Racket", it de

Re: [racket] Creating a #lang language, and modifying contract system

2011-08-05 Thread Ismael Figueroa Palet
Thanks Robby, I'll try to elaborate better on what I want to do. 2011/8/4 Robby Findler > The blame assignment stuff is wired pretty deep into the contract > system. There isn't currently any way to change that aspect of the > system without doing what you've done below. > > If you can say more

Re: [racket] Creating a #lang language, and modifying contract system

2011-08-05 Thread Ismael Figueroa Palet
Thanks a lot!! 2011/8/4 Danny Yoo > > Can someone please point me to documentation on how to create a language > > module so it can be used with #lang? I copied some module and hacked it > > until it worked, but I'm curious to know more details. > > > Sure! Have you seen this section in the Gui

Re: [racket] A function (in web-servlet) is expected to be invoked just once but seems to have more lives ...

2011-08-05 Thread Matthias Felleisen
You can send log entries to one of the things that DrRacket displays. It's a call to log-info or a ~5 line indirection function if you want additional info. See docs and see below. -- Matthias (define *n 0) ;; Sexpr -> Sexpr (define (logging tag x) (set! *n (+ *n 1)) (define msg (wit

Re: [racket] build error from 5.1.2 on i686-pc-linux-gnu

2011-08-05 Thread Marco Maggi
Matthew Flatt wrote: > At Fri, 05 Aug 2011 10:13:21 +0200, Marco Maggi wrote: >> Sorry, I notice now that Racket's build infrastructure is >> picking the file "stxparam.rkt" from an already installed >> Racket. So is this my problem (I must make already >> installed Rackets "invisi

Re: [racket] A function (in web-servlet) is expected to be invoked just once but seems to have more lives ...

2011-08-05 Thread J G Cho
Right on! Thank you. How can I have DrRacket display info (that would normally channel to 'log' such as http get etc)? Show log under View seems to do something different (more to do with DrRacket than the webserver). On Fri, Aug 5, 2011 at 3:47 AM, Veer wrote: > I think  #:servlet-regexp #rx""

Re: [racket] Creating ids from symbols

2011-08-05 Thread Matthew Flatt
At Fri, 5 Aug 2011 15:04:42 +0100 (BST), Mark Carter wrote: > It doesn't quite work: > > (define foo 42) > (define bar 'foo) > (namespace-set-variable-value! bar 43) > foo ; => 42, but I want it to be 43 Those 4 lines in a REPL produce 43, but my guess is that you have the code in a module. In a

Re: [racket] Creating ids from symbols

2011-08-05 Thread Mark Carter
>The `namespace-set-variable-value!' function might work. It doesn't quite work: (define foo 42) (define bar 'foo) (namespace-set-variable-value! bar 43) foo ; => 42, but I want it to be 43 I guess it's perfectly possible to work around it by defining a cache as a hash, and then getting an se

Re: [racket] Creating ids from symbols

2011-08-05 Thread Matthew Flatt
The `namespace-set-variable-value!' function might work. At Fri, 5 Aug 2011 08:59:09 +0100 (BST), Mark Carter wrote: > Is it possible to set an id from a symbol, call it set-symbol? For example, I > might type > (define life -12) > > (set-symbol 'life 42) > life ; => 42 > > The reason I want to

Re: [racket] build error from 5.1.2 on i686-pc-linux-gnu

2011-08-05 Thread Matthew Flatt
At Fri, 05 Aug 2011 10:13:21 +0200, Marco Maggi wrote: > Sorry, I notice now that Racket's build infrastructure is > picking the file "stxparam.rkt" from an already installed > Racket. So is this my problem (I must make already > installed Rackets "invisible") or a Racket problem?

Re: [racket] build error from 5.1.2 on i686-pc-linux-gnu

2011-08-05 Thread Marco Maggi
Marco Maggi wrote: > while building Racket 5.1.2 from racket-5.1.2-src-unix.tgz > on a i686-pc-linux-gnu with: > $ mkdir '=build' > $ ../src/configure --enable-shared --disable-static > $ make > I get the following error: > make normal-bin > ... > make[4]: Entering directory > `/home/m

[racket] Creating ids from symbols

2011-08-05 Thread Mark Carter
Is it possible to set an id from a symbol, call it set-symbol? For example, I might type (define life -12) (set-symbol 'life 42) life ; => 42 The reason I want to do this is so that I can store a cache of variables to disk. The cache will contain a list of variables to be stored. So I might ul

Re: [racket] A function (in web-servlet) is expected to be invoked just once but seems to have more lives ...

2011-08-05 Thread Veer
I think #:servlet-regexp #rx"" will match anything , if I remove it the application runs fine. Otherwise http://localhost:8080/servlets/standalone.rkt will match , so will http://localhost:8080/servlets/standalone2.rkt and so on. Most probably the browser is also requesting favicon.ico . You can

[racket] build error from 5.1.2 on i686-pc-linux-gnu

2011-08-05 Thread Marco Maggi
Ciao, while building Racket 5.1.2 from racket-5.1.2-src-unix.tgz on a i686-pc-linux-gnu with: $ mkdir '=build' $ ../src/configure --enable-shared --disable-static $ make I get the following error: make normal-bin ... make[4]: Entering directory `/home/marco/var/build/devel/racket-5.1.2