[plt-scheme] Scribble and here strings

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Jul 27 17:15:53 EDT 2009

On Jul 27, Jens Axel Søgaard wrote:
> Hi All,
> 
> What's the correct way of scribbling here strings?
> 
> This is what my code looks like:
> 
> (define-sql (create-table-entries)
> #<<SQL
> CREATE TABLE entries (
>   entry_id  INTEGER PRIMARY KEY,
>   title     TEXT,
>   url       TEXT,
>   score     INTEGER )
> SQL
> 
> I tried to wrap it in a simple @schemeblock[...] but that is not enough,
> due to the way the parser works.

I'm not sure that there is a `schemeblock' solution (at some point
we'll need something similar that works at the string level instead of
reading expressions), but a better way of writing that code is to not
use here strings:

  (define SQL string-append)
  (define-sql (create-table-entries)
    @SQL{
      CREATE TABLE entries (
        entry_id  INTEGER PRIMARY KEY,
        title     TEXT,
        url       TEXT,
        score     INTEGER )})

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.