chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] web-scheme & hart


From: Mario Domenech Goulart
Subject: Re: [Chicken-users] web-scheme & hart
Date: 05 Mar 2008 23:29:19 -0300
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Hi Robin,

On Wed, 5 Mar 2008 17:45:42 -0800 Robin Lee Powell <address@hidden> wrote:

> It seems to me that web-scheme and hart do more-or-less the same
> thing.  Unfortunetaly, I have no easy way to verify that because
> there are no examples at
> http://www.call-with-current-continuation.org/eggs/web-scheme.html
> and the exmaples it links to are 404.
> 
> So:
> 
> 1.  Can someone fix the examples link?

Sure.  Thanks for reporting this.  I've fixed the wiki page.  You can
find the examples at http://schemers.ucpel.tche.br/mario/examples
(they are pretty old and silly -- not to mention they are awfully
ugly).


> 2.  What's the difference between web-scheme and hart?  Do people
> have preferences between the two?

I don't know much about hart.  I think Graham can write about it.

Regarding to web-scheme, it's basically a bunch of procedures
implemented after HTML tags and some [hopefully] useful procedures,
macros and parameters for HTML generation.

For example,

    (p 'align "center" "Hello!")

would generate the string

    "<p align=\"center\">Hello!</p>\n"


Another one (which generates more things):

    (ws:page (ws:make-table '((1 2 3) (4 5 6))))

generates

    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" 
\"http://www.w3.org/TR/html4/strict.dtd\";>\n<html><head><meta  
http-equiv=\"Content-Type\" content=\"text/html; 
charset=iso-8859-1\">\n<title></title>\n</head>\n<body><table><tr><td>1</td>\n<td>2</td>\n<td>3</td>\n</tr>\n<tr><td>4</td>\n<td>5</td>\n<td>6</td>\n</tr>\n</table>\n</body>\n</html>\n"


There's a spiffy module which handles web-scheme pages:
http://chicken.wiki.br/spiffy#web-scheme-handler

Here's what I use to associate .ws files to the web-scheme handler:

  (use spiffy web-scheme web-scheme-handler)
  (spiffy-file-ext-handlers `(("ws" . ,web-scheme-handler)))

Hope it helps.

Best wishes,
Mario





reply via email to

[Prev in Thread] Current Thread [Next in Thread]