chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] wrong number of arguments to continuation when escap


From: Marco Maggi
Subject: Re: [Chicken-users] wrong number of arguments to continuation when escaping?
Date: Thu, 18 Jul 2019 08:13:53 +0200

Peter Bex wrote:

> On Thu, Jul 18, 2019 at 06:43:06AM +0200, Marco Maggi wrote:
>> I do not understand why some place expects 1 argument.  The problem goes
>> away if I replace:

>>    (escape)

>> with:

>>    (escape 1)

> Hi Marco,

> This is a known "issue", see #1390 and #1601.  Improving this so
> that such non-explicit "value" continuations accept different argument
> counts would have a big impact on performance because every single
> continuation would then need to start checking its argument count.

> It's unfortunate, but easy to fix; just use something like "receive"
> or "call-with-values" to explicitly allow the continuation to handle
> multiple values.

Not sure if I understand.  The problem  lies in the context in which the
call to DOIT is performed?  The code expects 1 value from:

   (doit)

so error; it expects one value in:

   (begin
     (doit)
     #t)

so error; it expects one value in:

   (let ()
     (doit)
     #f)

so error; it expects any number of values in:

   (call-with-values
       doit
     (lambda args (apply values args)))

so no error?
-- 
Marco Maggi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]