[parenscript-devel] APPLY with FLET/LABELS

Vladimir Sedach vsedach at gmail.com
Mon Jun 8 04:56:36 UTC 2009


Well, that wouldn't work in CL either. What was missing was 'function':

(ps (flet ((foo () 'bar))
          (apply #'foo nil)))

=>

"var foo8 = function () {
    'bar';
};
foo8.apply(this, null);"

Thanks for the bug report.

Vladimir

On Thu, Jun 4, 2009 at 9:43 AM, <sblist at me.com> wrote:
> Good morning,
>
> FLET and LABELS appears not to work with APPLY.
> Using regular function application or FUNCALL, the
> gensymed symbol is used:
>
> PS> (flet ((foo () 'bar))
>       (foo))
> BAR
> PS> (ps (flet ((foo () 'bar))
>        (foo)))
> "var foo1 = function () {
>     'bar';
> };
> foo1();"
>
> PS> (ps (flet ((foo () 'bar))
>        (funcall foo)))
> "var foo3 = function () {
>     'bar';
> };
> foo3();"
> PS>
>
> APPLY, however, does not use the gensym:
>
> PS> (ps (flet ((foo () 'bar))
>        (apply foo nil)))
> "var foo2 = function () {
>     'bar';
> };
> foo.apply(this, null);"
>
> - Scott
>
>
>
> _______________________________________________
> parenscript-devel mailing list
> parenscript-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>




More information about the parenscript-devel mailing list