[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of re
From: |
felix . winkelmann |
Subject: |
Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables |
Date: |
Sun, 30 Jun 2019 20:55:09 +0200 |
> I had a look at #1620 and as far as I can tell there's no reason why
> an aliased variable cannot be marked as replaceable when either the
> alias or the variable it aliases are captured.
>
> Captured simply means that it needs to be wrapped up in the closure,
> AFAIK. But if it's replaced, then the original variable will need
> to end up in the closure. The only case where you can't replace is
> if either variable is assigned to, because then they don't point to
> the same thing anymore.
>
> I've tested several eggs with this and it seems to work fine. The
> test case in #1620 is now compiled similar to the version with manually
> inserted eq? calls.
>
Yes, this appears to be the correct way - I wondered why there was not
an additional constraint on assignment, but since the order of optimizations
is not easily seen in advance, one has to be careful about many assumptions.
I think your reasing is correct, but must ask everybody to let me review this
for
a certain time before we commit this patch.
felix