[plt-scheme] Storing the result of a eval while in a continuation

From: Grant Rettke (grettke at acm.org)
Date: Sat Jul 14 19:39:48 EDT 2007

I am trying to understand the notion of how and why you would
returns a lambda closure with context as a parameter.

On 7/14/07, Hans Oesterholt-Dijkema <hdnews at gawab.com> wrote:
> Hi Grant,
>
> What is your question? Example of a plugin can be seen below.
> context is an object providing the current page context and request
> context of HWiki/PLT Web Server.
>
> --Hans
>
>
> (begin
>   (require (planet "hwikiplugin.scm" ("oesterholt" "hwiki.plt" 1 0)))
>
>   (lambda (context)
>       (let ((sqli (sqli-provider)))
>         (let ((R (begin
>          (sqli-query sqli "select page,title,part,time from register
> where context=$1 order by time desc limit 30" (-> context context))
>          `(div ((class "lastedits"))
>               (h1 ,(_ "Last edits for context '~a'" (-> context context)))
>               ,(append
>                 `(table ((align "center")) )
>                  '((tr  (th ((class "page")) "Page")
>                         (th ((class "part")) "Part")
>                         (th ((class "title")) "Title")
>                         (th ((class "time")) "Time")))
>                  (map (lambda (row)
>                          (apply (lambda (page title part time)
>                                   `(tr (td ((class "page")) ,(format
> "~a" page))
>                                        (td ((class "part")) ,(format
> "~a" part))
>                                       (td ((class "title")) ,(format
> "~a" title))
>                                        (td ((class "time")) ,(format
> "~a" time)))
>                                    )
>                                  row))
>                       (sqli-fetchall sqli)))
>              ))))
>           (sqli-closer sqli)
>           R)))
>
>
>
> Grant Rettke schreef:
> > On 7/10/07, Hans Oesterholt-Dijkema <hdnews at gawab.com> wrote:
> >> This evaluation returns a lambda closure with context as a parameter.
> >
> > What problem does that solve? How does that look?
> >
> > I've got an idea, but I am not so sure.
> >
> >
>


Posted on the users mailing list.