Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

help, trying to make a racket webserver

Name: Anonymous 2013-09-01 11:42

I'm getting


quasiquote: unbound identifier;
 also, no #%app syntax transformer is bound in: quasiquote


the code is

#lang web-server/insta
;; A "hello world" web server

(define x 0)

(define (start request) (response/xexpr `(html (body (h1 ,(number->string x))))))


(define (set-timeout msec thunk) (thread (lambda () (sync (alarm-evt (+ (current-inexact-milliseconds) msec))) (thunk))))


(define (f) (set-timeout 1000 (lambda () (set! x (+ x 1)) (f))))
(f)

(define z (with-input-from-file "hello.rktml" read))
z
(eval z)

I'm trying to get it to work before I change it to (response/xexpr (eval z))

and hello.rktml is

`(html (body (h1 ,(number->string x))))

weirdly enough, when I try (eval z) from the command line of drRacket it works

pls help

Name: Anonymous 2013-09-02 10:49

nvm, it seems eval is empty if called in the file
so I had to create a namespace and set x in it and pass it to eval, now it works

Name: Anonymous 2013-09-02 11:32

If you are doing what I think you are doing see https://dis.4chan.org/read/prog/1378043451/9 and set up a repo please.

Don't change these.
Name: Email:
Entire Thread Thread List