On 12/15/05, Immanuel Normann <firstname.lastname@example.org> wrote:
> My general objection is that there is no comprehensible separation
> between logic and layout in the surflets. I mean something like the so
> called "Modell View Control' design pattern. May be it is just a matter
> of insufficient documentation in this respect.
I don't quite understand what you mean with "logic" and "layout": The
program flow is very much seperated from the "layout" or "content",
that was the basic idea to develop SUrflets. E.g. the names of the
input fields ("layout") don't appear in the code ("logic"). And with
scheme you can write your simple routines that enter some text or even
input-fields in some point of the SXML-tree representing your web
However, there no such thing as a "Content Manager" where you have
your layout structure and just provide the content. Nevertheless, the
surflets let you create your own content manager. And I don't know of
any other server side scripting system where this could be easier (but
maybe I don't know enough server side scripting systems...)
> To give an example:
> Just by accident (i.e. by scanning some example code) I figured out how
> to set the width of a text input field with the function
This is described in the manual at
However, I admit that you have to know some HTML to provide the right
attributes to make-text-field, or, in general, use the SUrflet
functions. [Maybe you already know my favorite source for HTML
knowledge (assuming you know German): http://de.selfhtml.org/]
> But for instance I have no clue how to manipulate
> layout in the "surflet-form" function. I am not asking for special case
> problems, I am rather interested in the general concept concerning
> layout encoding inside the surflet functions.
What do you mean with "layout in the surflet-form function"? Within
surflet-form your are free with your layout, aren't you? Or do you
mean the attributes you want to provide the input-form? At
you see that surflet-form accepts HTML-attributes as a parameter,
which are inserted into the HTML <FORM...> entity.
> Moreover I have problems with "get-bindings": Appearently I can't use it
> to retrieve some hardcoded key-value pairs. get-bindings seems to
> support only generated key-value pairs (e.g. generated by make-text-field).
I don't understand what you mean with hardcoded vs. generated
key-value pairs. Get-bindings does not know where the key-value pairs
come from. It extracts both of them. Here's an example SUrflet that
(define-structure surflet surflet-interface
(define (main req)
(let ((bindings (get-bindings req)))
(display bindings) (newline) ; displays on terminal
(send-html/finish ; displays in browser
`(html (body (p "Bindings were "
,(format #f "~a" bindings)))))))
If you call the webpage with
Bindings where ((a . 2123))
> Right now I see only these two alternatives:
> 1) Use surflet build in functions like surflet-form => unclear how to
> influence the layout
(surflet-form k-url GET '(@ (accept-charset "ISO-8859-1 ISO-8859-2"))
> 2) Hardcode html => how do I get bindings?
with get-bindings and extract-bindings.
See example surflet above.
> I certainly would appriciate more documentation in this respect.
Did you already know the documentation and Howtos at
Hope that helps. If not, please let me know.