chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] wrong number of arguments to continuation when escaping?


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

Ciao,

  let's look at this script:

    (import (scheme)
            (chicken pretty-print))
    (define (doit)
      (call-with-current-continuation
          (lambda (escape)
              (pretty-print 'before)
              (pretty-print escape)
              (escape)
              (pretty-print 'after)
              (values))))
    (doit)

I compile and run it under CHICKEN 5.1.0:

$ csc -O1 -o demo demo.scm && ./demo
before
#<procedure (continuation . results)>

Error: bad argument count - received 0 but expected 1

        Call history:

        demo.scm:33: doit
        demo.scm:25: scheme#call-with-current-continuation
        demo.scm:27: chicken.pretty-print#pretty-print
        demo.scm:28: chicken.pretty-print#pretty-print
        demo.scm:29: escape             <--

I do not understand why some place expects 1 argument.  The problem goes
away if I replace:

   (escape)

with:

   (escape 1)

TIA
-- 
Marco Maggi



reply via email to

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