[racket] Failed to build Racket Textual 5.1.2 (CentOS)

2011-08-12 Thread Rodolfo Carvalho
Hello, I was trying to compile Racket Textual from source in a Webfaction's shared host machine. It's running CentOS 5.6. After downloading and extracting the tarball, cd racket-textual-5.1.2/src/; mkdir build; cd build; ../configure; make: ---

[racket] finally via macro

2011-08-12 Thread Zack Galler
Sam Phillips samdphillips@... writes: On Fri, Oct 8, 2010 at 4:40 PM, Jay McCarthy jay.mccarthy@... wrote: I use dynamic-wind for this. If there is something better, I don't know what it is. dynamic-wind is a little bit funny though because if you capture continuations then the in/out

Re: [racket] try/catch/finally idiom in Racket

2011-08-12 Thread Zack Galler
Sam Phillips samdphillips@... writes: Hi All, I understand using call-with-exception-handler/with-handlers/etc. to catch exceptions in a block of code, but I'm at a loss to what the best way to do a finally or cleanup action after a block of code. My intuition is to use dynamic-wind,

[racket] Problem with macro

2011-08-12 Thread Racket Noob
Hi all! I want to create macro for creating a DFA automaton (similar to one described here: http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/paper.pdf ) My desire is that, for example, this form (automaton init (init : (c - more)) (more : (a - more)

Re: [racket] finally via macro

2011-08-12 Thread Matthias Felleisen
dynamic-wind is the proper way to express 'finally' in Racket. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] Problem with macro

2011-08-12 Thread Jay McCarthy
2011/8/11 Racket Noob racketn...@hotmail.com: Hi all! I want to create macro for creating a DFA automaton (similar to one described here: http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/paper.pdf ) My desire is that, for example, this form (automaton init   

Re: [racket] Problem with macro

2011-08-12 Thread Casey Klein
On Fri, Aug 12, 2011 at 7:26 AM, Jay McCarthy jay.mccar...@gmail.com wrote: 2011/8/11 Racket Noob racketn...@hotmail.com: (define-syntax automaton   (syntax-rules (: - END)     [(_ init-state     (state : transition ...)     ...) (letrec ([curr-state empty]  

Re: [racket] Problem with macro

2011-08-12 Thread Robby Findler
Unfortunately, that position in a 'case' expression is not a place where macro expansion happens. You can, however, use a 'cond' instead of 'case'. Robby On Fri, Aug 12, 2011 at 7:33 AM, Casey Klein clkl...@eecs.northwestern.edu wrote: On Fri, Aug 12, 2011 at 7:26 AM, Jay McCarthy

Re: [racket] Problem with macro

2011-08-12 Thread Casey Klein
On Fri, Aug 12, 2011 at 7:39 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Unfortunately, that position in a 'case' expression is not a place where macro expansion happens. You can, however, use a 'cond' instead of 'case'. But you still can't use a macro like `process-state' to

Re: [racket] Problem with macro

2011-08-12 Thread Robby Findler
On Fri, Aug 12, 2011 at 7:49 AM, Casey Klein clkl...@eecs.northwestern.edu wrote: On Fri, Aug 12, 2011 at 7:39 AM, Robby Findler ro...@eecs.northwestern.edu wrote: Unfortunately, that position in a 'case' expression is not a place where macro expansion happens. You can, however, use a 'cond'

Re: [racket] Extending racket/gui with Gtk widgets

2011-08-12 Thread Matthew Flatt
At Tue, 26 Jul 2011 00:37:41 -0300, Diogo F. S. Ramos wrote: Is there a documented way to extend the racket/gui language with widgets already present in Gtk? For now, I'm particularly interested in using GtkSpinButton. I'm using Ubuntu and Racket v5.1.2.3. [Sorry for the delay in

Re: [racket] Problem with macro

2011-08-12 Thread Racket Noob
Oh, that's my problem: i obviously don't understand what's the places where macro expansion happens. I ended up writing classical lisp non-hygienic macro instead. It's a sad thing that I cannot find a book or text as clear as PG's On Lisp that covers Racket's hygienic macros in such

Re: [racket] finally via macro

2011-08-12 Thread Neil Van Dyke
Racket/Scheme language designers sometimes ask navel-gazing questions like What does it really mean to return a value? -- asked intelligently, not under the influence of psychoactives -- and this kind of thinking soon leads to greater insight and to more powerful programming language features.

Re: [racket] Failed to build Racket Textual 5.1.2 (CentOS)

2011-08-12 Thread Matthew Flatt
We've made some repairs in that area since 5.1.2, but I don't know if we've solved the problem that you're seeing. Which version of gcc are you using? At Fri, 12 Aug 2011 03:01:54 -0300, Rodolfo Carvalho wrote: Hello, I was trying to compile Racket Textual from source in a Webfaction's shared

Re: [racket] Problem with macro

2011-08-12 Thread Racket Noob
Thank you, Neil. I really appreciate your answer. I've just started programming with syntax-rules and I see now that I have lot to learn further about these scheme-way macros. Unfortunately, i'm currently unable to produce this macro with syntax-rules or syntax-case. But i have done it in

Re: [racket] Problem with macro

2011-08-12 Thread Casey Klein
On Fri, Aug 12, 2011 at 9:22 AM, Neil Van Dyke n...@neilvandyke.org wrote: 1. Without trying it, I'm pretty sure this particular syntax transformation can be done in syntax-rules, but I'm not certain it can be done using only the power of ... in syntax-rules, without a helper macro.  Your life

Re: [racket] Problem with macro

2011-08-12 Thread Carson Chittom
Neil Van Dyke n...@neilvandyke.org writes: (Pardon the writing in enumerations, but someone erroneously put caf coffee in the decaf coffee carafe.) Say *that* ten times fast. _ For list-related administrative tasks:

Re: [racket] Problem with macro

2011-08-12 Thread Danny Yoo
Oh, that's my problem: i obviously don't understand what's the places where macro expansion happens. I ended up writing classical lisp non-hygienic macro instead.  It's a sad thing that I cannot find a book or text as clear as PG's On Lisp that covers Racket's hygienic macros in such

Re: [racket] Problem with macro

2011-08-12 Thread Casey Klein
On Fri, Aug 12, 2011 at 10:44 AM, Danny Yoo d...@cs.wpi.edu wrote: Kent Dybvig's tutorial on syntax case was helpful for me:    http://www.cs.indiana.edu/~dyb/pubs/tr356.pdf I second that recommendation. It was a huge help to me when learning to write macros in Racket.

Re: [racket] Problem with macro

2011-08-12 Thread Racket Noob
Thank you, beautiful people! I'll take a look at Dybvig's article. And, i hope that upcoming book, Realm of Racket, will contain non-trivial chapter about racket-way macros. By the way, when will RoR be published? I'm so eager to see it! :) Racket Noob Date: Fri, 12 Aug 2011 11:05:30

Re: [racket] Problem with macro

2011-08-12 Thread Danny Yoo
2011/8/12 Racket Noob racketn...@hotmail.com: Thank you, beautiful people! I'll take a look at Dybvig's article. Also: http://blog.racket-lang.org/2011/04/writing-syntax-case-macros.html Hmmm... we need some consolidation. This material belongs in the Guide.

[racket] escaping binary data in url

2011-08-12 Thread Veer
Hello, Is there a way to encode/escape binary data in query part of url. For example : (require net/url) (define (escape-bytes bites) %ff%ff) (define hash (bytes 255 255)) (define a-url (string-url http://www.example.com/;)) (set-url-query! a-url (list (cons 'test (escape-bytes hash

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

2011-08-12 Thread Danny Yoo
I like how you show one way of converting a match to an object, and then show a better way. What I did not like very much is how the first way is really verbose and made me question whether to read on, and in retrospect the way using match isn't much less verbose. Wouldn't a simple (apply

[racket] local-expand and stop-lists?

2011-08-12 Thread Danny Yoo
I'm having some difficulty using local-expand with regards to stop lists. Here's what I'm trying: ;;; ;; small-lang.rkt #lang racket (provide (except-out (all-from-out racket)

Re: [racket] local-expand and stop-lists?

2011-08-12 Thread Sam Tobin-Hochstadt
On Fri, Aug 12, 2011 at 1:25 PM, Danny Yoo d...@cs.wpi.edu wrote: In which the first three lines are coming from compile-time, and I see that my lift-to-toplevel macro is firing off, even though I placed it in the stop-list of local-expand. What's happening here is that the `#%module-begin'

Re: [racket] escaping binary data in url

2011-08-12 Thread Danny Yoo
The library already does some URL encoding for you, as % is an illegal character in a query string, since that's the escape character itself for arbitrary bytes, %25 gets translated down to... ;;; (integer-char (string-number 25 16)) #\%

Re: [racket] local-expand and stop-lists?

2011-08-12 Thread Carl Eastlund
On Fri, Aug 12, 2011 at 1:39 PM, Danny Yoo d...@cs.wpi.edu wrote: On Fri, Aug 12, 2011 at 1:37 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Fri, Aug 12, 2011 at 1:25 PM, Danny Yoo d...@cs.wpi.edu wrote: In which the first three lines are coming from compile-time, and I see that my

Re: [racket] local-expand and stop-lists?

2011-08-12 Thread Danny Yoo
Darn it, I declared victory too soon, as usual. :) I'm still running into the same problem even switching out with #%plain-module-begin. Here's where I am now: ; ;;; small-lang.rkt #lang racket (provide

Re: [racket] local-expand and stop-lists?

2011-08-12 Thread Ryan Culpepper
On 08/12/2011 11:37 AM, Sam Tobin-Hochstadt wrote: On Fri, Aug 12, 2011 at 1:25 PM, Danny Yood...@cs.wpi.edu wrote: In which the first three lines are coming from compile-time, and I see that my lift-to-toplevel macro is firing off, even though I placed it in the stop-list of local-expand.

Re: [racket] local-expand and stop-lists?

2011-08-12 Thread Sam Tobin-Hochstadt
On Fri, Aug 12, 2011 at 1:58 PM, Ryan Culpepper r...@cs.utah.edu wrote: On 08/12/2011 11:37 AM, Sam Tobin-Hochstadt wrote: On Fri, Aug 12, 2011 at 1:25 PM, Danny Yood...@cs.wpi.edu  wrote: In which the first three lines are coming from compile-time, and I see that my lift-to-toplevel macro

Re: [racket] escaping binary data in url

2011-08-12 Thread Jay McCarthy
That's what the Web Server stuffers do http://docs.racket-lang.org/web-server/stateless.html#(part._stuffers) On Fri, Aug 12, 2011 at 11:38 AM, Danny Yoo d...@cs.wpi.edu wrote: The library already does some URL encoding for you, as % is an illegal character in a query string, since that's the

Re: [racket] local-expand and stop-lists?

2011-08-12 Thread Ryan Culpepper
On 08/12/2011 12:08 PM, Sam Tobin-Hochstadt wrote: On Fri, Aug 12, 2011 at 1:58 PM, Ryan Culpepperr...@cs.utah.edu wrote: On 08/12/2011 11:37 AM, Sam Tobin-Hochstadt wrote: On Fri, Aug 12, 2011 at 1:25 PM, Danny Yood...@cs.wpi.eduwrote: In which the first three lines are coming from

Re: [racket] Failed to build Racket Textual 5.1.2 (CentOS)

2011-08-12 Thread Rodolfo Carvalho
Hello, I checked that the version of GCC in the machine is way too old. GCC's website tells that GCC 4.4.6 is the oldest maintained release series. So maybe it's better to don't invest any time in fixing anything. I have a possibility to migrate to a newer server at Webfaction with newer GCC.

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

2011-08-12 Thread Eli Barzilay
On Saturday, Eric Hanchrow wrote: I would like to put in a plug for my dear friend Rudybot, written partly by Eli but mostly by me, now playing on #racket and #scheme on Freenode: https://github.com/offby1/rudybot It's written completely by Eric! -- My contribution was mostly in helping

[racket] Check syntax and disappearing bindings

2011-08-12 Thread Vincent St-Amour
I have a macro that restructures `let' binding lists, and I would like to have it play nice with Check Syntax. Here's an example: (let ([x 1.2+3.4i]) body ...) is expanded to: (let ([x-real 1.2] [x-imag 3.4]) body ...) with references to `x' replaced by references to `x-real' and

Re: [racket] Problem with macro

2011-08-12 Thread Grant Rettke
2011/8/12 Racket Noob racketn...@hotmail.com:  It's a sad thing that I cannot find a book or text as clear as PG's On Lisp that covers Racket's hygienic macros in such detailed manner. :( Be sure to read TSPL's section on syntax-rules and syntax-case and work through all of the problems.

[racket] compile-omit-paths and scribblings field

2011-08-12 Thread Danny Yoo
It appears that compile-omit-paths doesn't prevent a scribble file from being compiled, which is problematic if the scribble file requires another module that includes image snips. We're seeing that when we PLaneT install a package, that during compilation, we see this error message: raco

Re: [racket] compile-omit-paths and scribblings field

2011-08-12 Thread Danny Yoo
On Fri, Aug 12, 2011 at 9:00 PM, Robby Findler ro...@eecs.northwestern.edu wrote: I'm not following exactly-- are you saying that removing the scribblings field causes fewer files to be compiled? Yes. We're running into this situation when installing version 1.6 of tracer:

Re: [racket] escaping binary data in url

2011-08-12 Thread Veer
Since server part expects escaped data based on rfc 1738 , I assume that it will not be able to interpret the data as base64 encoding. As per bittorrent spec , the get request to tracker must have info_hash(20 byte sha) escaped along with others. Is there any other way to insert query part in url

Re: [racket] escaping binary data in url

2011-08-12 Thread Veer
This url http://localhost:8000/servlets/standalone.rkt?test=%ff causes server to close connection whereas http://localhost:8000/servlets/standalone.rkt?test=%23 does not , and works as expected. I suppose this is caused by use of net/url library, right? On Fri, Aug 12, 2011 at 11:43 PM, Jay