[plt-scheme] expansion continuations and barriers

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Jul 24 15:13:37 EDT 2007

It's an effect. -- Matthias


On Jul 24, 2007, at 2:14 PM, David Van Horn wrote:

> If I capture a continuation at expansion time and (later on during  
> expansion) try to invoke it, I get a continuation barrier error.   
> Why is this disallowed?
>
> Concretely:
>
> (module syntax-cc mzscheme
>   (provide (all-defined))
>   (require-for-syntax (lib "boundmap.ss" "syntax"))
>
>   (define-for-syntax m (make-module-identifier-mapping))
>
>   (define-syntax syntax-let/cc
>     (lambda (stx)
>       (syntax-case stx ()
>         ((_ x e)
>          (let/cc k
>            (module-identifier-mapping-put! m (syntax x) k)
>            (syntax e))))))
>
>   (define-syntax syntax-invoke/c
>     (lambda (stx)
>       (syntax-case stx ()
>         ((_ x e)
>          ((module-identifier-mapping-get m (syntax x))
>           (syntax e))))))
>   )
>
> (require syntax-cc)
> (syntax-let/cc k
>   (begin
>     (syntax-invoke/c k #t)
>     (let)))
>
> ;; ==expand==> #t, (let) is not expanded, so no compile time error.
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.