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

From: Grant Rettke (grettke at acm.org)
Date: Mon Jul 16 12:27:28 EDT 2007

Yes, that is wild, I've never thought of (or seen) something like that
before in any other language.

On 7/16/07, Hans Oesterholt-Dijkema <hdnews at gawab.com> wrote:
> Ehm. I'd like to be able to read the code, evaluate the code with
> eval and store the resulting code. To make it sensitive to different
> calling contexts, I've decided it is a good idea to make it a function
> that is called with a context.
>
> Does that answer your question?
>
> --Hans
>
>
> Op 14/7/2007 schreef "Grant Rettke" <grettke at acm.org>:
>
> >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.