chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] * eval.scm (compile): Remove failing envir


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] * eval.scm (compile): Remove failing environment lookup in ##core#set!
Date: Sat, 4 Aug 2018 10:42:02 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Fri, Aug 03, 2018 at 09:39:46PM +0300, megane wrote:
> 
> I couldn't come up with a way to test this. You
> can test the old one if you add print to the case and run this:
> 
> (let ([l '(##core#set! x 1)])
>   (##sys#current-environment (cons `(,l . foo) (##sys#current-environment)))
>   (eval l))

Ah, you're right.  It's not really a bug, just "dead code" in a way,
code that should never result in anything except #f, because the full
(##core#set! x 1) expression should never occur in the environment,
which should contain only variables.  You can't really test something
that never has an effect.

Attached is a signed-off copy of the patch.  I've also simplified the
code a little more, to reduce the need for the ";; static" comment.
It makes more sense to first check if the environment is static, then
give an error, otherwise look it up globally and compile to the correct
closure.  I think this is less awkward than the original code.

Cheers,
Peter

Attachment: 0001-eval.scm-compile-Remove-failing-environment-lookup-i.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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