[racket-users] package for the RacketCon 2018 web devel workshop

2018-10-03 Thread Jesse Alama
I made a package to go along with the web programming workshop held at
RacketCon 2018.

Install:

$ raco pkg install racketcon-2018-web-devel-workshop

Docs:

$ raco docs racketcon-2018-web-devel-workshop

The package contains a little raco command that exposes four HTTP
servers/applications, each illustrating different aspects of web devel
in Racket. Run

$ raco 2018-web-workshop help

to see how to invoke the different servers.

Code: https://github.com/jessealama/racketcon-2018-web-devel-workshop

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Upgrading Racket

2018-10-03 Thread James Platt
It turns out that the solution was to delete previously compiled code in 
various places.  I guess that things I was trying to run were trying to link to 
something, besides standard libraries, compiled under Racket 6.10. 

On Oct 3, 2018, at 3:48 PM, Philip McGrath wrote:

> Seeing that you're on Mac, `which raco` should help to confirm what version 
> of raco you have installed. (Interestingly, raco doesn't seem to support the 
> `--version` flag, which I think it probably should. `racket --version` does 
> work, but it's possible, albeit unlikely, that you could be have a raco that 
> doesn't match your racket.) 
> 
> If the version is wrong, the most likely place to have changed your path on 
> Mac would be in "~/.bash_profile". I personally recommend creating a file in 
> "/etc/paths.d/", which adds it for all users: e.g. `sudo echo 
> "/Applications/Racket v7.0/bin" >/etc/paths.d/racket`.
> 
> -Philip
> 
> 
> On Tue, Oct 2, 2018 at 9:53 PM James Platt  wrote:
> I'm just now getting back to this after returning from Racketcon.  I ran 
> `raco setup` as the user and again as root and it did not solve the problem.  
> So then I tried `raco setup -c` but this gave permission errors (unlike the 
> previous commands).  so I ran `sudo raco setup -c' and then `sudo raco 
> setup'.  I still get the same error.  Perhaps it's a matter of having a path 
> misconfigured somewhere, but where?
> 
> On Sep 28, 2018, at 9:33 PM, Tom Gillespie wrote:
> 
> > The compiled versions of all your modules are stale. One way to fix this is 
> > to run `raco setup`. On my system I have to run it as root, but you may be 
> > able to run it as the user that installed Racket.
> > 
> > On Friday, September 28, 2018 at 5:49:21 PM UTC-7, James wrote:
> > I just tried upgrading to Racket 7 on one of my machines (macOS 10.11.6) 
> > and I get the error shown below in DrRacket.  I thought I should mention it 
> > since I am probably not the only one.  I installed with the obvious method, 
> > which is to just drag the new Racket folder over to applications as it 
> > indicates in the disk image.  Did I miss some standard set of instructions 
> > for upgrading?  This happens any time I try to run something from DrRacket. 
> > 
> > read (compiled): wrong version for compiled code 
> >   compiled version: 6.10 
> >   expected version: 7.0 
> >   in: rkt/compiled/main_rkt.zo 
> > 
> > James
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] servlet development in REPL

2018-10-03 Thread Philip McGrath
While Jay and Sam have tried to answer the question you actually asked, my
advice would be to approach this differently. When I am developing web
server things interactively, I put them in the DrRacket definitions window
and run the program with the "Run" button. You can then poke at the running
server, see logging output, etc. at the DrRacket REPL. If I change
something, I change it in the DrRacket definitions window and press "Run"
again to re-start the server. (None of this is DrRacket-specific, but
that's how I do it, and I think it works especially well.)

I think this approach takes advantage of all of the generally nice things
about the Racket-style REPL. In particular, I could imagine getting
confused if I had `set!` part of the program to do something other than
what the definitions window said, and I could especially easily imagine
clicking run again without saving something I'd worked up interactively and
loosing that work.

The one place where this can be a downside is when the program has a very
long startup time. When I've had such cases, I've found it useful, even
beyond these circumstances, to give myself a hook to replace the expensive
parts with a noop when I don't actually care about them.

-Philip


On Wed, Oct 3, 2018 at 5:12 PM Cam  wrote:

>
> It looks like Sam's suggestion of racket-reloadable is exactly what I
> need, but I will play with this as well. Thanks!
>
> Jay McCarthy  writes:
>
> > You'd have to build it yourself, by doing a `set!` in the REPL to
> > inject the new function in.
> > On Wed, Oct 3, 2018 at 8:10 AM Cam  wrote:
> >>
> >>
> >> I am playing around with the built-in webserver functionality with
> >> `servlet/serve' and am wondering if there is a way to automatically
> >> "reload" the servlet, for lack of better terminology, when I am playing
> >> in the REPL. In other words, if I do something like this in the REPL:
> >>
> >> (define (about-page req)
> >>   (response/xexpr
> >>'(html (body (h1 "about")
> >>
> >> (define-values (dispatch handler->url)
> >>   (dispatch-rules
> >>[("about") about-page]))
> >>
> >> (serve/servlet
> >>  #:port 8088
> >>  #:listen-ip #f
> >>  #:servlet-path "/"
> >>  #:servlet-regexp #px".*"
> >>  dispatch)
> >>
> >> ...and then redefine `about-page' like this:
> >>
> >> (define (about-page req)
> >>   (response/xexpr
> >>'(html (body (h1 "something else")
> >>
> >> ...I would like to refresh my browser on the `/about' page and see
> >> "something else" instead of "about".
> >>
> >> Is there some way to achieve this?
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> > -=[ Jay McCarthy   http://jeapostrophe.github.io]=-
> > -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=-
> > -=[ Moses 1:33: And worlds without number have I created; ]=-
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Upgrading Racket

2018-10-03 Thread Philip McGrath
Seeing that you're on Mac, `which raco` should help to confirm what version
of raco you have installed. (Interestingly, raco doesn't seem to support
the `--version` flag, which I think it probably should. `racket --version`
does work, but it's possible, albeit unlikely, that you could be have a
raco that doesn't match your racket.)

If the version is wrong, the most likely place to have changed your path on
Mac would be in "~/.bash_profile". I personally recommend creating a file
in "/etc/paths.d/", which adds it for all users: e.g. `sudo echo
"/Applications/Racket v7.0/bin" >/etc/paths.d/racket`.

-Philip


On Tue, Oct 2, 2018 at 9:53 PM James Platt  wrote:

> I'm just now getting back to this after returning from Racketcon.  I ran
> `raco setup` as the user and again as root and it did not solve the
> problem.  So then I tried `raco setup -c` but this gave permission errors
> (unlike the previous commands).  so I ran `sudo raco setup -c' and then
> `sudo raco setup'.  I still get the same error.  Perhaps it's a matter of
> having a path misconfigured somewhere, but where?
>
> On Sep 28, 2018, at 9:33 PM, Tom Gillespie wrote:
>
> > The compiled versions of all your modules are stale. One way to fix this
> is to run `raco setup`. On my system I have to run it as root, but you may
> be able to run it as the user that installed Racket.
> >
> > On Friday, September 28, 2018 at 5:49:21 PM UTC-7, James wrote:
> > I just tried upgrading to Racket 7 on one of my machines (macOS 10.11.6)
> and I get the error shown below in DrRacket.  I thought I should mention it
> since I am probably not the only one.  I installed with the obvious method,
> which is to just drag the new Racket folder over to applications as it
> indicates in the disk image.  Did I miss some standard set of instructions
> for upgrading?  This happens any time I try to run something from DrRacket.
> >
> > read (compiled): wrong version for compiled code
> >   compiled version: 6.10
> >   expected version: 7.0
> >   in: rkt/compiled/main_rkt.zo
> >
> > James
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] LOP cultural anthropology, phases

2018-10-03 Thread Jesse Alama

On 1 Oct 2018, at 4:49, William G Hatch wrote:


I just read “Language Oriented Programming in Racket: A Cultural
Anthropology” on my flight home from Racketcon.  I enjoyed reading 
it,

and recommend it.


Just for reference (in case someone stumbles across this message in the 
future, or doesn't understand what's being referred to because they 
weren't at RacketCon):


William's referring to a project I carried out over the last six months 
or so -- prompted mainly by the publication of the CACM article 
(https://cacm.acm.org/magazines/2018/3/225475-a-programmable-programming-language/fulltext) 
-- to get my hands dirty with language-oriented programming. My approach 
was to survey many Racket programmers to get their sense of things. I 
collected and edited the results and gave the book a fancy name 
("anthropology"). Here's the project homepage:


  https://languagemakers.net/anthropology/

Jesse

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] servlet development in REPL

2018-10-03 Thread Cam


It looks like Sam's suggestion of racket-reloadable is exactly what I
need, but I will play with this as well. Thanks!

Jay McCarthy  writes:

> You'd have to build it yourself, by doing a `set!` in the REPL to
> inject the new function in.
> On Wed, Oct 3, 2018 at 8:10 AM Cam  wrote:
>>
>>
>> I am playing around with the built-in webserver functionality with
>> `servlet/serve' and am wondering if there is a way to automatically
>> "reload" the servlet, for lack of better terminology, when I am playing
>> in the REPL. In other words, if I do something like this in the REPL:
>>
>> (define (about-page req)
>>   (response/xexpr
>>'(html (body (h1 "about")
>>
>> (define-values (dispatch handler->url)
>>   (dispatch-rules
>>[("about") about-page]))
>>
>> (serve/servlet
>>  #:port 8088
>>  #:listen-ip #f
>>  #:servlet-path "/"
>>  #:servlet-regexp #px".*"
>>  dispatch)
>>
>> ...and then redefine `about-page' like this:
>>
>> (define (about-page req)
>>   (response/xexpr
>>'(html (body (h1 "something else")
>>
>> ...I would like to refresh my browser on the `/about' page and see
>> "something else" instead of "about".
>>
>> Is there some way to achieve this?
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> -- 
> -=[ Jay McCarthy   http://jeapostrophe.github.io]=-
> -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=-
> -=[ Moses 1:33: And worlds without number have I created; ]=-

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Why does my package have no build status?

2018-10-03 Thread David Storrs
On Wed, Oct 3, 2018 at 12:13 PM Sam Tobin-Hochstadt 
wrote:

> I'm not sure why you don't want to build some things. For example, the
> .scrbl files need to be built to allow documentation to appear on
> docs.racket-lang.org. However, the `compile-omit-files` key is what
> you'd want to use.
>
> Also, the build server runs your tests. You should just add a dependency.
>
> Sam
>

I'm using a non-standard testing framework and I would expect the build
server to choke on it.  This is also why I don't want it compiling some
things, specifically test_main.rkt and test_make_functional_setters.rkt
You're right about excluding too much, though -- I shouldn't have said
"anything aside from main.rkt" when I really only want to exclude the
testing files.

As to the dependency, there's no reason that people need to have
handy/test-more (the testing framework I use for struct-plus-plus)
installed in order to use the module.

It's not clear to me how to use compile-omit-files in an info.rkt file.
Are there examples I could look at?


On Wed, Oct 3, 2018 at 12:09 PM David Storrs  wrote:
> >
> > Cool, thanks.  How do I tell the server not to build anything aside from
> main.rkt?  The rest of what's there is module-private helpers.  I've looked
> through the docs on info.rkt and raco setup but had no luck.
> >
> > Also, how can I tell it to ignore certain dependencies?  It uses
> handy/test-more for testing, but that's not something the build server will
> know about or needs to know about.  I suppose I could put a #:platform
> 'none entry in the deps list, but that seems clunky.
> >
> >
> > On Wed, Oct 3, 2018 at 10:55 AM Sam Tobin-Hochstadt <
> sa...@cs.indiana.edu> wrote:
> >>
> >> I'm not sure why the status is missing on pkgs.racket-lang.org, but
> >> here's the build status:
> >> http://pkg-build.racket-lang.org/server/built/fail/struct-plus-plus.txt
> >>
> >> Sam
> >> On Wed, Oct 3, 2018 at 10:45 AM David Storrs 
> wrote:
> >> >
> >> > During RacketCon I posted struct-plus-plus to the packages list:
> https://pkgs.racket-lang.org/  Sadly, in the Build column it doesn't say
> "succeeds", "fails", or anything else...it's just a blank.  What do I need
> to do differently so that it can play all the reindeer games?
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> >> > To unsubscribe from this group and stop receiving emails from it,
> send an email to racket-users+unsubscr...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Why does my package have no build status?

2018-10-03 Thread Sam Tobin-Hochstadt
I'm not sure why you don't want to build some things. For example, the
.scrbl files need to be built to allow documentation to appear on
docs.racket-lang.org. However, the `compile-omit-files` key is what
you'd want to use.

Also, the build server runs your tests. You should just add a dependency.

Sam
On Wed, Oct 3, 2018 at 12:09 PM David Storrs  wrote:
>
> Cool, thanks.  How do I tell the server not to build anything aside from 
> main.rkt?  The rest of what's there is module-private helpers.  I've looked 
> through the docs on info.rkt and raco setup but had no luck.
>
> Also, how can I tell it to ignore certain dependencies?  It uses 
> handy/test-more for testing, but that's not something the build server will 
> know about or needs to know about.  I suppose I could put a #:platform 'none 
> entry in the deps list, but that seems clunky.
>
>
> On Wed, Oct 3, 2018 at 10:55 AM Sam Tobin-Hochstadt  
> wrote:
>>
>> I'm not sure why the status is missing on pkgs.racket-lang.org, but
>> here's the build status:
>> http://pkg-build.racket-lang.org/server/built/fail/struct-plus-plus.txt
>>
>> Sam
>> On Wed, Oct 3, 2018 at 10:45 AM David Storrs  wrote:
>> >
>> > During RacketCon I posted struct-plus-plus to the packages list: 
>> > https://pkgs.racket-lang.org/  Sadly, in the Build column it doesn't say 
>> > "succeeds", "fails", or anything else...it's just a blank.  What do I need 
>> > to do differently so that it can play all the reindeer games?
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Racket Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an 
>> > email to racket-users+unsubscr...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Why does my package have no build status?

2018-10-03 Thread David Storrs
Cool, thanks.  How do I tell the server not to build anything aside from
main.rkt?  The rest of what's there is module-private helpers.  I've looked
through the docs on info.rkt and raco setup but had no luck.

Also, how can I tell it to ignore certain dependencies?  It uses
handy/test-more for testing, but that's not something the build server will
know about or needs to know about.  I suppose I could put a #:platform
'none entry in the deps list, but that seems clunky.


On Wed, Oct 3, 2018 at 10:55 AM Sam Tobin-Hochstadt 
wrote:

> I'm not sure why the status is missing on pkgs.racket-lang.org, but
> here's the build status:
> http://pkg-build.racket-lang.org/server/built/fail/struct-plus-plus.txt
>
> Sam
> On Wed, Oct 3, 2018 at 10:45 AM David Storrs 
> wrote:
> >
> > During RacketCon I posted struct-plus-plus to the packages list:
> https://pkgs.racket-lang.org/  Sadly, in the Build column it doesn't say
> "succeeds", "fails", or anything else...it's just a blank.  What do I need
> to do differently so that it can play all the reindeer games?
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Why does my package have no build status?

2018-10-03 Thread Sam Tobin-Hochstadt
I'm not sure why the status is missing on pkgs.racket-lang.org, but
here's the build status:
http://pkg-build.racket-lang.org/server/built/fail/struct-plus-plus.txt

Sam
On Wed, Oct 3, 2018 at 10:45 AM David Storrs  wrote:
>
> During RacketCon I posted struct-plus-plus to the packages list: 
> https://pkgs.racket-lang.org/  Sadly, in the Build column it doesn't say 
> "succeeds", "fails", or anything else...it's just a blank.  What do I need to 
> do differently so that it can play all the reindeer games?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Why does my package have no build status?

2018-10-03 Thread David Storrs
During RacketCon I posted struct-plus-plus to the packages list:
https://pkgs.racket-lang.org/  Sadly, in the Build column it doesn't say
"succeeds", "fails", or anything else...it's just a blank.  What do I need
to do differently so that it can play all the reindeer games?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] servlet development in REPL

2018-10-03 Thread Sam Tobin-Hochstadt
You will probably be interested in the `reloadable` package:
https://github.com/tonyg/racket-reloadable/

Sam
On Wed, Oct 3, 2018 at 8:10 AM Cam  wrote:
>
>
> I am playing around with the built-in webserver functionality with
> `servlet/serve' and am wondering if there is a way to automatically
> "reload" the servlet, for lack of better terminology, when I am playing
> in the REPL. In other words, if I do something like this in the REPL:
>
> (define (about-page req)
>   (response/xexpr
>'(html (body (h1 "about")
>
> (define-values (dispatch handler->url)
>   (dispatch-rules
>[("about") about-page]))
>
> (serve/servlet
>  #:port 8088
>  #:listen-ip #f
>  #:servlet-path "/"
>  #:servlet-regexp #px".*"
>  dispatch)
>
> ...and then redefine `about-page' like this:
>
> (define (about-page req)
>   (response/xexpr
>'(html (body (h1 "something else")
>
> ...I would like to refresh my browser on the `/about' page and see
> "something else" instead of "about".
>
> Is there some way to achieve this?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] servlet development in REPL

2018-10-03 Thread Jay McCarthy
You'd have to build it yourself, by doing a `set!` in the REPL to
inject the new function in.
On Wed, Oct 3, 2018 at 8:10 AM Cam  wrote:
>
>
> I am playing around with the built-in webserver functionality with
> `servlet/serve' and am wondering if there is a way to automatically
> "reload" the servlet, for lack of better terminology, when I am playing
> in the REPL. In other words, if I do something like this in the REPL:
>
> (define (about-page req)
>   (response/xexpr
>'(html (body (h1 "about")
>
> (define-values (dispatch handler->url)
>   (dispatch-rules
>[("about") about-page]))
>
> (serve/servlet
>  #:port 8088
>  #:listen-ip #f
>  #:servlet-path "/"
>  #:servlet-regexp #px".*"
>  dispatch)
>
> ...and then redefine `about-page' like this:
>
> (define (about-page req)
>   (response/xexpr
>'(html (body (h1 "something else")
>
> ...I would like to refresh my browser on the `/about' page and see
> "something else" instead of "about".
>
> Is there some way to achieve this?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
-=[ Jay McCarthy   http://jeapostrophe.github.io]=-
-=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=-
-=[ Moses 1:33: And worlds without number have I created; ]=-

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] servlet development in REPL

2018-10-03 Thread Cam


I am playing around with the built-in webserver functionality with
`servlet/serve' and am wondering if there is a way to automatically
"reload" the servlet, for lack of better terminology, when I am playing
in the REPL. In other words, if I do something like this in the REPL:

(define (about-page req)
  (response/xexpr
   '(html (body (h1 "about")

(define-values (dispatch handler->url)
  (dispatch-rules
   [("about") about-page]))

(serve/servlet
 #:port 8088
 #:listen-ip #f
 #:servlet-path "/"
 #:servlet-regexp #px".*"
 dispatch)

...and then redefine `about-page' like this:

(define (about-page req)
  (response/xexpr
   '(html (body (h1 "something else")

...I would like to refresh my browser on the `/about' page and see
"something else" instead of "about".

Is there some way to achieve this?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.