Summary

sandbox egg test fails on missing ##sys#eval-decorator procedure

Metadata

Attachments

Description

When running chicken-install -test sandbox, the second to last test exercising the fuel limit fails with Error: unbound variable: ##sys#eval-decorator. This can be resolved by replacing the respective call in the sandbox sources with the definition of eval-decorator in core's eval.scm. It's unclear whether that will break compatibility with C4 though.

Changes and comments

[2021-10-17 10:43:56 UTC] ecloud wrote:

Confirmed. The egg is not usable this way, AFAICT; I ran into it like this:

       <eval>    [[widget-property-set!]|] (safe-environment-set! eval-env (quote parent) (-> widget parent))
       <eval>    [[widget-property-set!]|] (->impl291 widget (quote292 parent))
       <eval>    [[widget-property-set!]|] (safe-environment-set! eval-env (quote self) widget)
       <eval>    [[widget-property-set!]|] (safe-eval parsed #:environment eval-env)      <--

and your suggestion fixes it:

 Index: sandbox.scm
 ===================================================================
 --- sandbox.scm (revision 37281)
 +++ sandbox.scm (working copy)
 @@ -222,8 +222,21 @@
                 x2) )
           x2) ) )
  
 +(define (eval-dec p ll h cntr)
 +  (##sys#decorate-lambda
 +   p 
 +   (lambda (x) (and (not (##sys#immediate? x)) (##core#inline "C_lambdainfop" x)))
 +   (lambda (p i)
 +     (##sys#setslot 
 +      p i 
 +      (##sys#make-lambda-info 
 +       (let ((o (open-output-string)))
 +         (write ll o)
 +         (get-output-string o))))
 +     p) ) )
 +
    (define (decorate p ll h)
 -    (##sys#eval-decorator p ll h #f) )
 +    (eval-dec p ll h #f) )
  
    (define (compile x e h)
      (check-point fuel/compile)

[2021-10-23 19:25:11 UTC] ecloud wrote:

Anyway I'm having trouble getting safe-environment-macro-set! to do what I want; not sure if this fix has something to do with it, or it's just my little experience writing any kind of macros. The docs are not at all clear on what the "procedure of one argument" ought to return. So I keep getting the "illegal non-atomic object" error for almost everything I try.

[2022-04-04 16:52:45 UTC] wasamasa attached 0001-Use-eval-decorator-from-C5.patch (description=#f)

[2022-04-04 16:52:51 UTC] wasamasa attached 0001-Improve-test-suite-to-check-for-error-messages.patch (description=#f)

[2022-04-04 17:42:12 UTC] felix changed status from new to closed

[2022-04-04 17:42:12 UTC] felix set resolution to fixed

[2022-04-04 17:42:12 UTC] felix wrote:

The patches have been applied (r41254)