Re: Tail call optimization

2025-02-13 Thread Alexander Burger
On Thu, Feb 13, 2025 at 07:38:10AM +0100, Alexander Burger wrote: > When I built the tco version yesterday, I experimended with both > versions, and somehow the 'M' code was lost :( OK, I will settle with this version: # Print next digit of PI (de digit (Env) (job Env (tco (Q

Re: Tail call optimization

2025-02-13 Thread Alexander Burger
On Thu, Feb 13, 2025 at 08:50:16AM -0800, Lindsay Lawrence wrote: > I think it is also a good a test/example of picolisp's support for bignums. Indeed. The numbers in the 'E' environment get quite big. After ten thousand digits of PI, 'S' and 'Q' have 145746 digits and 'R' has 145748 digits. I ve

Re: Tail call optimization

2025-02-13 Thread Lindsay Lawrence
On Thu, Feb 13, 2025 at 9:37 AM Alexander Burger wrote: > On Thu, Feb 13, 2025 at 08:50:16AM -0800, Lindsay Lawrence wrote: > > I think it is also a good a test/example of picolisp's support for > bignums. > > Indeed. The numbers in the 'E' environment get quite big. After ten > thousand digits o

Re: Tail call optimization

2025-02-13 Thread Lindsay Lawrence
> > > > Sorry again for the confusion! > > 👍 I think it is also a good a test/example of picolisp's support for bignums. It could be a fun exercise to implement a version of this with one of the other Pi algorithms that discards already computed digits so it could essentially just churn out digit

Re: Tail call optimization

2025-02-13 Thread Lindsay Lawrence
On Thu, Feb 13, 2025 at 9:37 AM Alexander Burger wrote: > On Thu, Feb 13, 2025 at 08:50:16AM -0800, Lindsay Lawrence wrote: > > I think it is also a good a test/example of picolisp's support for > bignums. > > Indeed. The numbers in the 'E' environment get quite big. After ten > thousand digits o