Re: [racket] Lisp game development on Reddit

2010-11-09 Thread Richard Lawrence
Matthias Felleisen writes: > We should start with a Racket version for Land of Lisp. > It would be much nicer in the Universe world than in an > old Lisp world. I think this would be really cool! I was thinking of doing this for my own edification. It might be fun for interested parties to

Re: [racket] cdata section is not normalized by read-xml

2010-11-09 Thread Jay McCarthy
It is documented that way: http://docs.racket-lang.org/xml/index.html#(def._((lib._xml/main..rkt)._cdata)) I'm not sure why it was originally written that way. Jay On Tue, Nov 9, 2010 at 9:53 PM, YC wrote: > Hi all - > read-xml apparently does not normalize/strip the wrapper > when creating t

[racket] cdata section is not normalized by read-xml

2010-11-09 Thread YC
Hi all - read-xml apparently does not normalize/strip the wrapper when creating the cdata struct. Is there a reason why they are not stripped? #lang scheme (require xml) (define xml "") (define xexpr (xml->xexpr (document-element (read-xml (open-input-string xml) (cdata-string (last xexp

Re: [racket] scribble examples using student language printer

2010-11-09 Thread David Van Horn
On 11/7/10 6:58 AM, Matthew Flatt wrote: At Sun, 07 Nov 2010 01:51:29 -0400, David Van Horn wrote: Is there a way to make scribble render the result of evaluating examples as if the examples were run in a student language in DrRacket? In addition to initializing the namespace, you need to set

[racket] Land of Lisp (was: Lisp game development on Reddit)

2010-11-09 Thread Mike G.
On Mon, Nov 08, 2010 at 10:38:40PM -0500, Matthias Felleisen wrote: > > We should start with a Racket version for Land of Lisp. > It would be much nicer in the Universe world than in an > old Lisp world. How is _Land of Lisp_? It looks tempting, and I might finally get to apply some of the gr

Re: [racket] CGI headers

2010-11-09 Thread Sam Phillips
On Tue, Nov 9, 2010 at 12:39 PM, scouic wrote: > and the error log : > [Tue Nov 09 21:26:09 2010] [error] [client 127.0.0.1] Premature end of > script headers: try.cgi > [Tue Nov 09 21:26:09 2010] [error] [client 127.0.0.1] try.cgi:1:0: read: > expected only alphanumeric, `-', `+', `_', or `/' cha

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread Peter Breitsprecher
As much as I want to look at that I want to pass or fail this one on my own.. Otherwise I'm just cheating myself... On 9 November 2010 16:27, namekuseijin wrote: > On Tue, Nov 9, 2010 at 6:50 PM, Peter Breitsprecher > wrote: > > Ok, here is the exact assignment. > > > > Tiny Scheme Details: Th

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread namekuseijin
On Tue, Nov 9, 2010 at 6:50 PM, Peter Breitsprecher wrote: > Ok, here is the exact assignment. > > Tiny Scheme Details: The Scheme or LISP that you are going to implement > should include the following primitives: hey, it's you lucky day! Tiny Scheme is implemented already and is an open-source

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread John Clements
On Nov 9, 2010, at 12:50 PM, Peter Breitsprecher wrote: > Ok, here is the exact assignment. Blecch, I don't like this assignment :). Based on the text, it appears that your professor wants you to do both parsing and evaluation. And some GUI stuff. Glug. Here's what I'd do: since your profes

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread Peter Breitsprecher
Ok, here is the exact assignment. * * *Tiny Scheme Details**:* The Scheme or LISP that you are going to implement should include the following primitives: *T, NIL, CAR, CDR, CONS, ATOM, EQ, NULL, INT,* *PLUS, MINUS, TIMES, LESS, GREATER COND, QUOTE, DEFINE.* T and NIL represent true and false.

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread John Clements
On Nov 9, 2010, at 12:32 PM, Peter Breitsprecher wrote: > Ok, here is the code I have written so far for the function I am having > trouble with... I'm also a bit curious: does your assignment say anything about using or not using 'read' ? John Clements smime.p7s Description: S/MIME crypto

Re: [racket] CGI headers

2010-11-09 Thread scouic
Hey, with the command line mzscheme it works, so i don't know where is the problem : actually, try.cgi is this one : #!c:/Racket/mzscheme.exe (display "HTTP/1.1 200 OK \r\n") (display "Content-type: text/plain; charset=iso-8859-1 \n\n") (display "hello") The apache access log says : 127.0.0.1 - -

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread John Clements
On Nov 9, 2010, at 12:32 PM, Peter Breitsprecher wrote: > Ok, here is the code I have written so far for the function I am having > trouble with... > > (define (rep-loop) > (newline) > (display "repl>") > (read-token)) I'm going to ignore rep-loop. > > (define (read-token) > (let ((e

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread Peter Breitsprecher
Ok, here is the code I have written so far for the function I am having trouble with... (define (rep-loop) (newline) (display "repl>") (read-token)) (define (read-token) (let ((expr (read-char))) ((cond [(char-whitespace? expr) (read-token1)] [(eq? expr #\() (read-token2)]

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread John Clements
On Nov 9, 2010, at 12:27 PM, Peter Breitsprecher wrote: > I'd lie but no.. I was just trying to clarify what I was looking for. I gave > a the code for one of the functions I had written, and then an example of the > input the user is giving below, and then tried to describe in more detail >

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread Peter Breitsprecher
I'd lie but no.. I was just trying to clarify what I was looking for. I gave a the code for one of the functions I had written, and then an example of the input the user is giving below, and then tried to describe in more detail what I needed help with... On 9 November 2010 15:23, Shriram Krishna

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread Shriram Krishnamurthi
Hi, That would not be considered an "example" for at least two reasons. Do you see why? On Nov 9, 2010 12:17 PM, "Peter Breitsprecher" wrote: As an example, I want have most of the functions for Plus, Minus already written. Here is the code for it. (define (plus num1 num2) (+ num1 num2)) Tha

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread Peter Breitsprecher
As an example, I want have most of the functions for Plus, Minus already written. Here is the code for it. (define (plus num1 num2) (+ num1 num2)) That is childs stuff... Here is where I am having the problem, and please keep in mind I am new to DrRacket... If my program accepts input such as

Re: [racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread John Clements
On Nov 9, 2010, at 11:48 AM, Peter Breitsprecher wrote: > I am in the process of writing a simple scheme interpreter for a class I > have. I am running into an issue with regards to parsing the input properly. > I will try and explain what I want to do and tell me if I am way off base or > n

[racket] Simple Scheme Interpreter written in Drracket

2010-11-09 Thread Peter Breitsprecher
I am in the process of writing a simple scheme interpreter for a class I have. I am running into an issue with regards to parsing the input properly. I will try and explain what I want to do and tell me if I am way off base or not. I have a procedure set up to read the input from the user. Whic

Re: [racket] Difficult key-binding

2010-11-09 Thread Eduardo Bellani
Thanks, worked like a charm! On 11/09/2010 03:38 PM, Ryan Culpepper wrote: > Eduardo Bellani wrote: >> But as you can see here: >> >> (define (diva-link:frame-mixin super%) ... ) >> >> diva-link is a frame-mixin. So my problem is probably my lack of >> understanding of the mixin mechanism. But my

Re: [racket] CGI headers

2010-11-09 Thread Everett Morse
You may want to check out the documentation here: http://docs.racket-lang.org/guide/scripts.html?q=script which discusses running Racket in scripts. Also, as suggested by other people, you should try running this from the command line first. Thanks, -Everett On 11/09/2010 10:09 AM, Sam Ph

Re: [racket] Lisp game development on Reddit

2010-11-09 Thread Everett Morse
I made the example from the free chapter (ch 8, the Hunt the Wumpus game) work in Racket last week by writing macros and function definitions to get the LISP code running under Racket with minimal modifications. I haven't gotten to rewriting it in Universe yet, but I did wonder if it would hav

Re: [racket] Difficult key-binding

2010-11-09 Thread Ryan Culpepper
Eduardo Bellani wrote: But as you can see here: (define (diva-link:frame-mixin super%) ... ) diva-link is a frame-mixin. So my problem is probably my lack of understanding of the mixin mechanism. But my doubt remains, with a clearer cause :) The file diva-link.ss has many mixins. Line 572 (fr

Re: [racket] Difficult key-binding

2010-11-09 Thread Eduardo Bellani
But as you can see here: (define (diva-link:frame-mixin super%) ... ) diva-link is a frame-mixin. So my problem is probably my lack of understanding of the mixin mechanism. But my doubt remains, with a clearer cause :) Thanks for the reply On 11/09/2010 03:15 PM, Robby Findler wrote: > close-cu

Re: [racket] Difficult key-binding

2010-11-09 Thread Robby Findler
close-current-tab is a method on the frame, I believe. Robby On Tue, Nov 9, 2010 at 11:12 AM, Eduardo Bellani wrote: > Hello there. > > I am trying to add this keybinding, but without success: > > (keybinding "c:x;c:k" (λ (editor evt) >                        ;; close current tab (or buffer) >  

[racket] Difficult key-binding

2010-11-09 Thread Eduardo Bellani
Hello there. I am trying to add this keybinding, but without success: (keybinding "c:x;c:k" (λ (editor evt) ;; close current tab (or buffer) (send editor close-current-tab))) The error I got is this: send: no such method: close-current-tab for cla

[racket] Difficult key-binding

2010-11-09 Thread Eduardo Bellani
Hello there. I am trying to add this keybinding, but without success: (keybinding "c:x;c:k" (λ (editor evt) ;; close current tab (or buffer) (send editor close-current-tab))) The error I got is this: send: no such method: close-current-tab for cla

Re: [racket] CGI headers

2010-11-09 Thread Sam Phillips
On Mon, Nov 8, 2010 at 9:37 PM, scouic wrote: > What's wrong here ? Must i write #lang racket at the top, must i change > mzscheme.exe with gracket.exe ... ? > I don't really understand why i've an apache internal server error ... > ps : in my apache httpd.conf i've the line > AddHandler cgi-scrip

Re: [racket] duplicate/copy a namespace

2010-11-09 Thread Kevin Tew
I've been wanting to implement a fork-like feature for places where a new place is created as a clone of its parent. A deep namespace-copy could be useful in that scenario. On 11/08/2010 04:49 PM, Jay McCarthy wrote: Could namespaces be dicts and we could write dict-copy? Jay On Mon, Nov 8, 2

Re: [racket] CGI headers

2010-11-09 Thread Noel Welsh
Does this script work from the command line? If not, it certainly won't work from the web server. If it does work from the cmd line that will get us some way to debugging it. N. On Tue, Nov 9, 2010 at 5:37 AM, scouic wrote: > test.cgi : > #!c:\Program Files (x86)\DrRacket\mzscheme.exe > (display