chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Spiffy - ssp-handler - how to extend ssp-eval-enviro


From: Peter Bex
Subject: Re: [Chicken-users] Spiffy - ssp-handler - how to extend ssp-eval-environment
Date: Tue, 27 Mar 2012 09:21:13 +0200
User-agent: Mutt/1.4.2.3i

On Mon, Mar 26, 2012 at 07:08:38PM -0300, Arthur Maciel wrote:
> Dear Peter, thanks for the info!
> 
> What I would like when doing web programming (and specially when using
> Awful, which should be called Wonderful) is to have a clear separation
> between data processing and its presentation (model/controller vs view
> separation) and ssp-handler seemed to do this for me.

ssp encourages mixing your logic with your presentation, just like PHP or
ERB does.

> I believe a good way to do this would be to have page definitions with
> Awful 'define-page' procedure, that at the end would call a procedure that
> would hold all the view part (html-tags code for example) with an alist
> with parameters.

That's fine and you don't need ssp for that.

> Am I doing it Wrong(TM)? Is the above example to PHPcentric or imperative?

Not at all.  In fact, it's a great way of doing things, and you don't need
ssp for that at all.  You can define the code in regular .scm files, which
can live outside the docroot (which is much more secure).

Then you can load this code from your Spiffy startup file.  If you want
reloadable code, you could look into the "system" egg for that.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

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