Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-10-07 Thread megane
Peter Bex writes: > On Sat, Jul 20, 2019 at 11:51:28AM +0300, megane wrote: >> Here's a new patch that drops the (not captured) check. > > Thanks for making that! Now that my original patch has been pushed, > here's an incremental patch based on yours which only drops that check. > > Cheers, >

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-10-06 Thread felix . winkelmann
> On Sun, Sep 15, 2019 at 01:16:50PM +0200, Peter Bex wrote: > > On Sun, Aug 25, 2019 at 04:34:02PM +0200, Peter Bex wrote: > > > On Sat, Jul 20, 2019 at 11:51:28AM +0300, megane wrote: > > > > Here's a new patch that drops the (not captured) check. > > > > > > Thanks for making that! Now that

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-10-06 Thread Peter Bex
On Sun, Sep 15, 2019 at 01:16:50PM +0200, Peter Bex wrote: > On Sun, Aug 25, 2019 at 04:34:02PM +0200, Peter Bex wrote: > > On Sat, Jul 20, 2019 at 11:51:28AM +0300, megane wrote: > > > Here's a new patch that drops the (not captured) check. > > > > Thanks for making that! Now that my original

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-09-15 Thread Peter Bex
On Sun, Aug 25, 2019 at 04:34:02PM +0200, Peter Bex wrote: > On Sat, Jul 20, 2019 at 11:51:28AM +0300, megane wrote: > > Here's a new patch that drops the (not captured) check. > > Thanks for making that! Now that my original patch has been pushed, > here's an incremental patch based on yours

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-08-25 Thread Peter Bex
On Sat, Jul 20, 2019 at 11:51:28AM +0300, megane wrote: > Here's a new patch that drops the (not captured) check. Thanks for making that! Now that my original patch has been pushed, here's an incremental patch based on yours which only drops that check. Cheers, Peter From

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-20 Thread megane
Peter Bex writes: > On Thu, Jul 11, 2019 at 03:15:00PM +0300, megane wrote: >> Of course if this is dropped the other conditions must still meet. >> [...] >> >> Here's a correct way to drop the (not captured) check: >> >> (and (not assigned) >>(or (and (not (db-get db name 'unknown))

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-11 Thread Peter Bex
On Thu, Jul 11, 2019 at 03:15:00PM +0300, megane wrote: > Of course if this is dropped the other conditions must still meet. > > Here's your proposed condition: > > (and (not captured) >(or (and (not (db-get db name 'unknown)) > (db-get db name 'value)) >

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-11 Thread megane
megane writes: > Peter Bex writes: > > Regarding the capturing, the capture test is still there: > > >> (when (and value (not global)) >> (when (eq? '##core#variable (node-class value)) >> - (let* ((name (first (node-parameters value))) >> -(nrefs (db-get

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-05 Thread Peter Bex
On Fri, Jul 05, 2019 at 09:13:36AM +0300, megane wrote: > I reduced this case to this: > > (define (foo bindings) > (define (append-map proc lst1) > (if lst1 > (proc 1) > (proc 1 2))) > (append-map (lambda (b a) (begin)) bindings)) > > Error: ../fail.scm:5:

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-05 Thread megane
Peter Bex writes: > On Wed, Jul 03, 2019 at 02:05:21PM +0200, Peter Bex wrote: >> You're right, good catch! That was an oversight on my part, I only >> removed the captured check of the other variable. I hope this makes >> things faster in more cases. I can make and test a new patch, but

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-04 Thread megane
megane writes: > Peter Bex writes: > >> On Wed, Jul 03, 2019 at 02:05:21PM +0200, Peter Bex wrote: >>> You're right, good catch! That was an oversight on my part, I only >>> removed the captured check of the other variable. I hope this makes >>> things faster in more cases. I can make and

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-04 Thread megane
Peter Bex writes: > On Wed, Jul 03, 2019 at 02:05:21PM +0200, Peter Bex wrote: >> You're right, good catch! That was an oversight on my part, I only >> removed the captured check of the other variable. I hope this makes >> things faster in more cases. I can make and test a new patch, but

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-04 Thread Peter Bex
On Wed, Jul 03, 2019 at 02:05:21PM +0200, Peter Bex wrote: > You're right, good catch! That was an oversight on my part, I only > removed the captured check of the other variable. I hope this makes > things faster in more cases. I can make and test a new patch, but don't > know when I'll get

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-03 Thread Peter Bex
On Wed, Jul 03, 2019 at 02:54:24PM +0300, megane wrote: > Regarding the capturing, the capture test is still there: > > > (when (and value (not global)) > >(when (eq? '##core#variable (node-class value)) > > -(let* ((name (first (node-parameters value))) > > -

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-07-03 Thread megane
Peter Bex writes: > Hi all, > > 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, >

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-06-30 Thread Peter Bex
On Sun, Jun 30, 2019 at 08:55:09PM +0200, felix.winkelm...@bevuta.com wrote: > 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

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-06-30 Thread felix . winkelmann
> 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,

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-06-30 Thread felix . winkelmann
> On Sun, Jun 30, 2019 at 11:33:17AM -0400, John Cowan wrote: > > Obviously this is not something you can do in a patch, > > but at some point Chicken may want to go > > over to the assignment conversion strategy, in which all mutable > > local variables are transformed into immutable references

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-06-30 Thread Peter Bex
On Sun, Jun 30, 2019 at 11:33:17AM -0400, John Cowan wrote: > Obviously this is not something you can do in a patch, > but at some point Chicken may want to go > over to the assignment conversion strategy, in which all mutable > local variables are transformed into immutable references to boxes.

Re: [Chicken-hackers] [PATCH] Fix #1620 by ignoring captured state of replaced variables

2019-06-30 Thread John Cowan
On Sun, Jun 30, 2019 at 9:57 AM Peter Bex wrote: 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,