[parenscript-devel] BLOCK/RETURN-FROM

sblist at me.com sblist at me.com
Tue Jun 7 16:40:21 UTC 2011


Hi,

I was wondering if the BLOCK/RETURN-FROM feature in PS intends
to support the following case:

(ps (defun foo ()
          (flet ((bar () (return-from foo 42)))
            (bar))))

=>

WARNING: Returning from unknown block FOO
"function foo() {
    var bar = function () {
        return 42;
    };
    return bar();
};"

In order to try and get around the warning, I tried this:

(ps (defun baz ()
          (block foo
            (flet ((bar () (return-from foo 42)))
              (bar)))))

=>

WARNING: Returning from unknown block FOO
"function baz() {
    var bar = function () {
        return 42;
    };
    return bar();
};"

but that didn't seem to work. Any ideas on how to achieve lexical 
return here?

	- Scott





More information about the parenscript-devel mailing list