Re: [racket-users] Programming for blind students - sample code needed

2018-01-04 Thread Christopher Lemmer Webber
schanzer writes: > Hi all - happy new year Racketeers! > > For the last two years, we've been thinking about making programming > accessible for differently-abled students. We're focusing first on students > with visual and sensorimotor impairments, by building an editor that allows > students to

[racket-users] Scopes and shadowing syntax-rules literals

2018-01-04 Thread Greg Rosenblatt
Hi, I've been experimenting with various corner cases of the macro system to better understand the implementation. For comparison, I've also been running the experiments in Chez Scheme. I found a difference of opinions when running the following two tests. The idea is to test under what

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread 'Royall Spence' via Racket Users
I'd enjoy a #lang that parses Jinja templates. They've proliferated to all the major web languages and work nicely, so a Racketized version seems like an obvious upgrade. On Thu, Jan 4, 2018, at 3:23 PM, Matthew Butterick wrote: > >> On Jan 4, 2018, at 11:47 AM, Jay McCarthy >>

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Matthew Butterick
> On Jan 4, 2018, at 11:47 AM, Jay McCarthy wrote: > > FWIW, txexpr is essentially just `xexpr->string` but it sees when you > put in a `script` or `style` and it puts the `make-cdata` for you. (It > also does a bit more checking to make sure the xexpr is well-formed.)

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Neil Van Dyke
David Storrs wrote on 01/04/2018 02:27 PM: [...] (xexp->html   (html->xexp "This is

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Jens Axel Søgaard
tor. 4. jan. 2018 kl. 17.48 skrev Matt Jadud : > > What is the best way to generate HTML from the webserver? I don't care > about XML vs. HTML; I just want the fastest path to writing a small web > application that solves a problem that I have, and part of that means > easily

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Jay McCarthy
FWIW, txexpr is essentially just `xexpr->string` but it sees when you put in a `script` or `style` and it puts the `make-cdata` for you. (It also does a bit more checking to make sure the xexpr is well-formed.) On Thu, Jan 4, 2018 at 2:30 PM, Philip McGrath wrote: >

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Philip McGrath
(For posterity, because I realized I didn't explicitly say this:) The cdata structure effectively just tells functions like `write-xexpr` to write the string it contains without any escaping. In particular, it doesn't add the "" implied by using CDATA in actual XML, which is what we take

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread David Storrs
Speaking of the html-writing module, I noticed this in the docs: (xexp->html > (html->xexp > "This is > [Result is:] "This isbold italic text." > That does not seem like a correct result. "

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Norman Gray
Greetings. On 4 Jan 2018, at 19:07, Philip McGrath wrote: > P.S.: I was very comfortable reading and writing HTML and XML-ish notation > long before I came to Racket, and I initially resisted giving up my > angle-brackets (to the extent of fiddling around with reader extensions), > but I have

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Matt Jadud
Many thanks for all of the responses. I have no fear of the parentheses, and will likely end up with a number of wrappers like you describe, Phillip. I hadn't (yet) twigged to possibly wrapping things up in a CDATA section, but that makes sense. Now if we just had a Racket library that shoveled

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Philip McGrath
FWIW, I use `response/xexpr` in production with a `#:preamble` of `#"\n"`, and I haven't run into problems. The biggest non-obvious thing, since I see you're generating a script element, is that `response/xexpr` (and the underlying `xexpr->string`/` write-xexpr`) properly escape < and & in body

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread David Storrs
What would the characteristics of the perfect library be? Some easy things that come to mind: - automatically generate the boilerplate -- DTD, tags, etc - convenient methods for converting a LoL into a table - able to "literate assemble" template fragments from the disk On Thu, Jan 4, 2018 at

Re: [racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Jay McCarthy
I don't think the perfect library exists, because HTML has changed considerably since most Racket libraries were written. I think xexpr do 90% of the job, but fails on the issues mentioned in that issue. I think the best option right now is either txexpr ---

[racket-users] What is the right way to generate HTML from the web server?

2018-01-04 Thread Matt Jadud
Hi all, I read through this issue: https://github.com/racket/racket/issues/577 and am in the "what is going on?" category of user when it comes to HTML generation in Racket. What should I be using to generate responses from a servlet? response/xexpr? Does that generate HTML I can use