[plt-scheme] Continuation marks question

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat May 12 20:24:31 EDT 2007

So, I decided to go with the approach Robby mentioned. I've got a
special key and when I rewrite the code, I record the cm-key and the
cm-value and then reinstitute it. (I realized that it doesn't matter
about marks introduced by other modules, because the only ways they
would be in one of my continuations is if one of my lambdas was used
in a higher-order way, which I already disallow.)

Now the problem I'm having now. This works great for normal
continuation marks, such as the following "simple parameters":

  (define (make-simple-parameter-lookup id)
    (lambda ()
      (let ([cur
             (continuation-mark-set->list
              (current-continuation-marks)
              id)])
        (if (null? cur)
            (error 'simple-parameter "~S Not defined in context!" id)
            (car cur)))))
  (define (simple-parameterize id v bt)
    (with-continuation-mark id v (bt)))

However, with actual parameters, they use the `parameterization' data
structure. These are not serializable, and they probably shouldn't be
given the thread-state properties. However, if you only use parameters
with parameterize, then it seems safe to implement them like my
simple-parameters.

As a general question to the PLT community, in the serializable web
language, should I hijack the parameter methods and syntax, or come up
with some new name, that you will have to use when writing programs
with serializable parameter values?

Jay

ps If not obvious, I'm updating Pettyjohn's prototype. With this last
step, I am supporting the entire PLT kernel syntax, so I think almost
any servlet will work without modification, excepting the use of
call/cc in the context of higher order functions.

-- 
Jay McCarthy <jay.mccarthy at gmail.com>
http://jay.teammccarthy.org


Posted on the users mailing list.