Re: closures

2008-10-30 Thread John Duncan
I thought Chicken's approach seemed novel, but I don't understand it well enough to explain it. From what I gather, they use the C stack as the new heap and collapse it when the garbage collector copies. John On 30 Oct 2008, at 3:56 AM, Alexander Burger wrote: class continuations like

Re: closures

2008-10-26 Thread Tomas Hlavaty
Hi Alex, (let @S '((I . 0)) (def 'count (curry (@S) () (job '@S (inc 'I (def 'reset (curry (@S) () (job '@S (zero I ) (let @S (list (cons 'I 0)) (let I (cons 0) I like it this way, thanks. I also found that once the things inside the closures get complicated,

Re: closures

2008-10-26 Thread Alexander Burger
Hi Tomas, ... (zero A) ... .. Have you measured and/or noticed impact on performance of these micro-optimizations? I mean, are they really worth it? Very probably not ... it is similar to the situation with 'do' ;-) Still I think it is good to have certain convenience functions that don't

Re: closures

2008-10-26 Thread Tomas Hlavaty
Hi Alex, Have you measured and/or noticed impact on performance of these micro-optimizations? I mean, are they really worth it? Very probably not ... it is similar to the situation with 'do' ;-) When you work on the 64 bit version, you obviously implemented miniPicoLisp prototype and now

Re: closures

2008-10-24 Thread Alexander Burger
Hi Tomas, Perhaps there are other/better solutions? Do you have anything on mind? Unfortunately not. I just had the feeling there must be other ways ;-) But perhaps using a cell is not such a bad idea ... Why 'zero', 'one', 'on', 'off' and 'onOff' don't evaluate arguments? ... which

Re: closures

2008-10-24 Thread Alexander Burger
On Fri, Oct 24, 2008 at 05:54:10PM +0200, Alexander Burger wrote: Do you have anything on mind? Unfortunately not. I just had the feeling there must be other ways ;-) Perhaps I was too much in a hurry yesterday ... There is a kind of middle way between our two solutions: (let @S '((I .