[parenscript-devel] APPLY with FLET/LABELS

sblist at me.com sblist at me.com
Mon Jun 8 15:51:07 UTC 2009


Hi Vladimir,

We had our own FUNCTION macro which expanded
into the original symbol, but after removing that
and using your patch everything works just fine.

Thanks for looking at these reports and fixing them
so quickly!

- Scott

On 7-Jun-09, at 10:56 PM, Vladimir Sedach wrote:

> 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
>>
>
> _______________________________________________
> 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